write and append to a file using shell programming
i recently wrote a program using shell programming. i prompted for entries but i don't how to write this entry to a file..if the file already exist..can i append to the existing file? i search for the linux commands but couldnt find one though..please help..thanks
|
you can send output to a file with '>' and append to the end of a file with '>>'
|
try :
echo "$data" > file or echo "$data" >> file where $data is the data you want to write, and file is the file you want to write it to. the first (with > ) will overwrite the file if it exists already, and the second (with >> ) will append if the file exists already. I could give you more specific help if you showed me more of the source code you have already. |
ok...i wrote this
Quote:
thanks |
Quote:
how about something like Code:
echo "Enter the number of employees" |
ok..i'll try that out but what does "seq" means? why can't i just directly use number instead? sorry for troubling but i don't understand and i want to understand.
|
All times are GMT -5. The time now is 09:23 AM. |