Link to home
Start Free TrialLog in
Avatar of LuckyLuciano
LuckyLuciano

asked on

Create a file with few lines from Shell Script

Dear All,

I would like to create a file from a unix shell script, and this file should contains only few lines.
What sort of command I can use to achieve this ?

eg: in the normal unix form, i would normally use :
1. vi testfile
2. and then the empty screen comes out then i put in several lines with esc+i
3. esc and :wq
4. and file is ready

Moreless i want to apply this to the scripting, can you advice please ?
Thank you in advance.

LL
Avatar of Tintin
Tintin

echo "This is some content for a new file" >filename
Avatar of LuckyLuciano

ASKER

Hi Tintin, what if i want to have several lines like below :

===========
This is the first line for a new file

This is the second line after one empty line ( enter )
===========


ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial