Linux help [Closed]

Report
-
Posts
21331
Registration date
Wednesday November 3, 2004
Status
Moderator, Security contributor
Last seen
October 30, 2019
-
Hey right, this is a quicky. i want a script where the user types in some data in command line,
it saves it and formats it.

i no that i can use " cat >> Filename" to create the file and to place data in it.
but i cant seem to close it and then be able to format that data all in one srcipt

please Help Quick

1 reply

Posts
21331
Registration date
Wednesday November 3, 2004
Status
Moderator, Security contributor
Last seen
October 30, 2019
2
Hi,

Like this?!

lami20j@debian:~/trash$ cat <<END >file.txt
> i no that i can use " cat >> Filename" to create the file and to place data in it.
> but i cant seem to close it and then be able to format that data all in one srcipt
> END
lami20j@debian:~/trash$ cat file.txt
i no that i can use " cat >> Filename" to create the file and to place data in it.
but i cant seem to close it and then be able to format that data all in one srcipt

You must use Here Documents of shell. You can look Here Documents in man bash.