Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    India
    Posts
    41

    Unanswered: Need Help in writing a Shell Script.

    Hi EveryB
    Iam writting a shell script which needs to pick a file (one by one)from the directory and do certain processing on it.
    The files in the dir appear in the following format:

    -rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2501-01050216-.log
    -rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2501-01050216-.log
    -rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2501-01050216-.log

    -rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2503-01050216-.log
    -rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2503-01050216-.log

    -rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2505-01050216-.log
    -rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2505-01050216-.log

    -rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2507-01050216-.log
    -rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2509-01050216-.log

    I am getting an error if i try to list the file name which is not present.Is there any possible way to solve this prblm.

    eg:
    while [ ls -ltr TAP25$count* ]
    do

    // certain Processing.

    count = `expr count + 2`
    done

    Thanks in Advance,
    Arun

  2. #2
    Join Date
    Aug 2004
    Location
    Rome, Italy
    Posts
    81
    Maybe it is better to use the instruction
    for i in TAP25*
    do
    some work.....
    done

    bye,
    ducasio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •