Re: Taking input line by line from a config file in Bash

2008-01-08 Thread Matthew_S
I'm having a bit of trouble with one of the lines in my config file. 'ls -l | cut -d ' ' -f1' doesn't want to pass through the script. Here's the output; ls -l | cut -d ' ' -f1 ls: |: No such file or directory ls: cut: No such file or directory ls: ': No such file or directory ls: ': No such fi

Re: Taking input line by line from a config file in Bash

2008-01-03 Thread Matthew_S
I see what you're saying. That's interesting about cat, thanks for the heads up. while read line do { echo $line > /dev/null && echo $line "PASSED" || echo $line "FAILED" } >> $RESULTS done < $FILE exit 0 This does

Re: Taking input line by line from a config file in Bash

2008-01-02 Thread Bob Proulx
Matthew_S wrote: > With the 'while read line', it appears that I don't need to keep track of > the line numbers. In fact this below does exactly what I need it to do; Good. > cat $File | # Supply input from a file Search the web for "useless use of cat". Your use of it here is useless. But

Re: Taking input line by line from a config file in Bash

2008-01-02 Thread Matthew_S
Hi Bob, Thanks for the quick reply. With the 'while read line', it appears that I don't need to keep track of the line numbers. In fact this below does exactly what I need it to do; cat $File | # Supply input from a file while read line # As you suggested... do echo $line

Re: Taking input line by line from a config file in Bash

2008-01-02 Thread Bob Proulx
Matthew_S wrote: > For arguments sake I’ve put ‘I want this whole line on one line’ into the > config file and the script looks like this; > > for i in `cat config.txt` The result of this will be split on words. That is not what you want. > It’s been suggested that I try read and so I have this