Linux help [Closed]

- - Latest reply: lami20j
Posts
21511
Registration date
Wednesday November 3, 2004
Status
Moderator, Security contributor
Last seen
October 30, 2019
- Feb 14, 2009 at 03:35 PM
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
See more 

1 reply

Posts
21511
Registration date
Wednesday November 3, 2004
Status
Moderator, Security contributor
Last seen
October 30, 2019
2
0
Thank you
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.