,
Share with your friends 

To create a text file using shell script

7 ratings Views 125 
Author: Avinash.R. (Avinash.R. Maharaj)  View Profile |  View other solutions by this author

Question / Problem


How to create a text file using shell script?

Solution

To create a shell script

vi file.sh
echo "name
name
name
name" > filename
:wq

To run the shell script:

sh file.sh

Output:

cat filename
name
name
name
name


Applies to

Solaris

Rank It

Login to rank it

Report


Advertisement