Thread: shell scripts?

  1. #1
    Unregistered
    Guest

    shell scripts?

    Hi ? i have a simple shell script program in Bourne Shell..
    and would like someone to help me out here...

    exitstatus=1

    for i in `find $1 -group $2 -print`
    do
    if grep -s '^'$i'$' $oughttobe
    then
    exitstatus=0
    else
    if grep `ls -l $i | awk '{printf "%s",$3}'` $owners >>$names
    then
    echo $i >>$names
    exitstatus=0
    fi
    fi
    done
    exit $exitstatus


    Would someone be able to answer this question for me please?
    How many command line arguments are expected and what do they each represent?

    The script makes use of some other variables, eg, names, owners etc..:what would make these variables available to it..

    if someone can answer these question for me, that would be much appreciated.

    Cheers,
    Syed

  2. #2
    The Artful Lurker Deckard's Avatar
    Join Date
    Jan 2002
    Posts
    633

    Re: shell scripts?

    Originally posted by Unregistered
    How many command line arguments are expected and what do they each represent?
    Two (a path and a group name). The script is looking for any files owned by a certain group ($2), and begins its search in the directory specified by $1. If a matching file is found, it greps the file to see if it contains the value of $oughttobe. It is not clear from this script what the value of $oughttobe ought to be (okay, bad pun).

    If grep indicates the file contains whatever $oughttobe is, the name of the owner is appended to the file referred to as $names.

    Originally posted by Unregistered
    The script makes use of some other variables, eg, names, owners etc..:what would make these variables available to it..
    I'm going to guess that this script is meant to be called from another script, and that the variables are exported from the calling script.
    Jason Deckard

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What shell is more powerful?
    By xddxogm3 in forum Tech Board
    Replies: 10
    Last Post: 07-24-2004, 10:47 PM
  2. Bash Shell Scripts
    By jennydarma in forum C Programming
    Replies: 1
    Last Post: 12-13-2002, 05:24 AM
  3. System.ini Shell Problems
    By (TNT) in forum Windows Programming
    Replies: 2
    Last Post: 08-26-2001, 01:05 PM