So, (yes this is tangentially related homework, but I think this question is legal, because it isn't directly related to the assignment.)
I have a file, I want to append the 5th fields (aka 5th column) of that file into another file:
from the CLI:
Code:
awk '{print $5}' fileone >> file2
cat file2
output:
word
word
word
(yes, this is what I want.)
so, I put that line in a bash file
Code:
awk '{print $5}' fileone >> file2
echo `cat file2`
this will output
word word word
(this is not what I want)
why is this doing this?
Code:
me $ bash --version
GNU bash, version 3.2.25(1)-release (i686-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
The code has to run on these machines, so is there a work around to inserting a newline after each word?