I'm relatively new to shell scrpting and I want to know how you can read from the stdin interactively from a script and then append that variable to an existing file. Please can anyone help?
read a # get a line of something from stdin
print $a >> a_file.txt # append that to a file
Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.