Kleeb wrote:
> #!/bin/bash
> date
> echo -e "\nHere is the table of the syndicate numbers:\n"
> cat -n /home/foo/lottery.txt
> echo -e "\nWinning Numbers:\n"
> cat /home/foo/winhope.txt
> echo -e "\nMatching Lines:\n"
> grep -nof /home/foo/winhope.txt /home/foo/lottery.txt
>
>
> That's it.
>
> When I try to run this via puTTY as explained above, the script can never
> find the files 'winhope.txt' or 'lottery.txt', even though I know for sure
> the paths are correct. It also can't find the 'date' command either. Hmm.
in shell scripts it's often a good idea to use full paths to commands, so
type `/bin/date` rather than just `date'. (this doesn't go for echo and a
couple of other commands that are bash built-ins, though.)
i have no idea why your script doesn't find the files when you log in
through ssh, but it could be helpful if you posted the actuall errors you
get.
> When I view the script in vim, only the 'echo' and 'grep' commands are
> highlighted, 'date' and 'cat' are just plain text.
that's irrelevant. vim's font-lock determines which keywords get
highlighted and which don't.
--
Joost Kremers
joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)