1st script attempt; cygwin; fails "bash: myscript : command not found"
Hello, this should be in the newbie^^2 forum, I know.... But I just downloaded cygwin to my xp machine.....Tried my first experimental script and created it one level directly below where cygwin put me by default. The script, named showtwo says....
#!/bin/bash echo $1 echo $2 But bash apparently can't find it..... The name of the script is showtwo, but I also tried naming it showtwo.sh; no dice. |
Quote:
|
Quote:
but what the OP does not understand is that you need to call programs in the local directory with ./ |
its an xp machine
|
right. I did not know (forgot since last used unix 25 years ago)that...
Furthermore, if I am a level above where the script is, I invoke by... ./oneleveldowndir/showtwo and so on.... so the natural followup is... what do I do to make a script invokable without specifying the full pathname? Or please refer to appropriate tutorial so I don't waste more time here.... |
you could put it in your path enviroment.
|
It's a (sane!) default for unix/linux shells not to have
the current working directory in the path. Either use the full path, or a relative path to execute the script. ./script or /home/username/script Cheers, Tink |
You could edit your ~/.bashrc and modify the PATH variable
export PATH=${PATH}:. Don't do that for root, though, if you get to a real Unixy kind of box. It's a security risk. |
Quote:
|
All times are GMT -5. The time now is 11:59 AM. |