Try with double-quotes, i.e. "`cat $file`"
cheers
--
Contro i brevetti software - Against software patents
http://petition.eurolinux.org - http://no-patents.prosa.it
Which shell are you using? Here (bash) I can't reproduce thisQuote:> When I cat a file on the command line each field (3 fields) are on the
> same line, but when I try to use `cat $file` in a script, each of the
> 3 fields are all on separate lines and it's screwing up my program.
Michael
> Try with double-quotes, i.e. "`cat $file`"
> cheers
> --
> Contro i brevetti software - Against software patents
> http://petition.eurolinux.org - http://no-patents.prosa.it
That worked! Thanks so much!
1. Why can't I field-separate this line?
I have a line like this by doing 'tail -1 somefile':
/dev/hda3 28851852 5759880 23091972 20% /
What I want to do is first print only the first column (/dev/hda3) and
eventually extract the hda3 out of it. But, tail -1 somefile | gawk
-F=" " '{print $1}' only gives me the entire line. I am suspecting
it's because of the /s in the line. How would I get around this?
Thanks,
-j
2. cvs server: cannot open /root/.cvsignore: Permission denied
3. Why is `cat` parsing lines?
5. script to separate characters of a line in a file
6. Help with Possible system hack !!! how to find more info ?
7. How to do 'for line in `cat file`; do' in bourne shell?
9. # How to read a textfile line by line using csh shell script ?
10. unix shell script to access a file line by line
11. How to read text line-by-line in shell script?
12. Accessing a shell script w/o doing . /script
13. Question about shell script, can you enter a script at a specific line?