cat
takes a filename as its argument. You definitely need echo
. What you may have wrong is that the line read will be space-separated, so cut
needs a -d " "
.
However, why not use the -r
option of read
?
$ read -r NAME FNAME AGE FILE < file $ echo $NAME Doe $ echo $FNAME John $ echo $AGE 36 $ echo $FILE johns_letter.pdf $ echo $FILE | sed -e "s/.pdf/.html/" johns_letter.html