![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Modifying file from outside | Sreejith_VK | Shell Programming and Scripting | 9 | 08-21-2008 01:57 AM |
| Help need in modifying the text of .txt file | vinna | Shell Programming and Scripting | 2 | 07-17-2008 03:21 PM |
| can someone help me with modifying this file | eamani_sun | Shell Programming and Scripting | 2 | 05-22-2008 01:15 PM |
| Modifying a csv file from Shell Script | not4google | Shell Programming and Scripting | 2 | 11-21-2006 06:47 AM |
| Modifying the final output file | charbel | Shell Programming and Scripting | 5 | 10-10-2006 01:36 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Modifying a .ksh file
Hi,
i have created a simple .ksh file in the following manner Code:
cat <<EOF >mfile #!/bin/ksh echo "hello world" EOF 1. now i would like to add a second line after the first echo command e.g. echo "this is line 2" how can i do that ? 2. I would then like to delete the first line Code:
echo "hello world" Thanks in advance, C Last edited by Yogesh Sawant; 03-31-2009 at 01:45 PM.. Reason: added code tags |
|
||||
|
cat <<EOF >mfile
#!/bin/ksh echo "hello world" EOF I have 2 questions 1. now i would like to add a second line after the first echo command e.g. echo "this is line 2" how can i do that ? Solution : append the new line to the exist data in the file by using : Code:
$ echo "this is line 2" >>mfile 2. I would then like to delete the first line echo "hello world" Solution : open the file using vi $vi mfile step 1 : now go to ex mode by clicking ":" then type 1d this will delete the first line from the script or else u can use standard commands to achieve the same Last edited by Yogesh Sawant; 03-31-2009 at 01:46 PM.. |
| Sponsored Links | ||
|
|