Linux help

Closed
Bugz - Feb 9, 2009 at 11:34 AM
lami20j Posts 21331 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
Related:

1 response

lami20j Posts 21331 Registration date Wednesday November 3, 2004 Status Moderator, Security contributor Last seen October 30, 2019 2
Feb 14, 2009 at 03:35 PM
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.
0