I have a file like this:
one
two
three
four
I would like use a for loop in a bash script in order to scan the file line for line. Previously I used cut
but I was not able to give the cut
command the newline delimiter, how can I that?
In this way it does not work :
cut -d'\n' -f1
Any suggestion ?
I found myself in the same problem, this works for me:
cat file.cut | cut -d$'\n' -f1
Or:
cut -d$'\n' -f1 file.cut