shell script problem

Discussion in 'Software' started by Shadowchaser, Jul 30, 2006.

  1. Shadowchaser

    Shadowchaser A Really Great Guy

    Having a problem with a project for school that is due tomorrow night. I have reviewed the man and info files with no success for what is being returned to me. Anyone have any ideas what is wrong with my script? Here's the assignment:


    Here is my script so far:

    My problem lies between lines 49 and 67 but for the life of me I can't seem to see where my mistake in my coding is. Any help would be appreciated. Thanks!

    Jack
     
  2. Shadowchaser

    Shadowchaser A Really Great Guy

    Just a couple of addendums here. First I call the script with the following command:

    $ bash test3.sh dogs junk

    dog and junk are both regular files in the current directory. Neither are directories. The error I get is that it exits out with the following:

    As you can see, the script is considering the files to be directories and is exiting out with an error code of 0 which would mean true. I have tried setting the exit at 1 to no avail.

    Below is the directory listing on this machine:

    I really can't see where I've gone wrong here. Any help is greatly appreciated.

    Jack
     
  3. Shadowchaser

    Shadowchaser A Really Great Guy


MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds