![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| simple sed question | funksen | Shell Programming and Scripting | 10 | 04-08-2007 02:54 PM |
| sed - simple question | scotty_123 | Shell Programming and Scripting | 13 | 03-28-2007 11:23 PM |
| Simple C question... Hopefully it's simple | Xeed | High Level Programming | 6 | 12-15-2006 11:29 AM |
| Ok simple question for simple knowledge... | Corrail | UNIX for Dummies Questions & Answers | 1 | 11-28-2005 10:03 AM |
| Simple ksh question | frustrated1 | Shell Programming and Scripting | 1 | 11-05-2003 09:41 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Simple Question
Hi Guys,
I've been learning UNIX for the past couple of days and I came across this exercise, I can't get my head around it, so I would be ever so grateful if I could receive some sort of help or direction with this. Create a file with x amount of lines in it, the content of your choice. Write a script named 'firstline' that takes two arguments. The first being a line of text, the second being your newly created file. The script should take the first argument and insert it into the very top (the first line) of the file named in your second argument. Take a copy (backup) and amend the above script so that it now inserts the first argument into the middle of the file. The problem I have is that I dont know how to edit a text using shell scripts. Any help would be greatly appreciated Thanks, aforball |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
You can use ex or sed among other things. This kinda seems like homework.
|
|
#3
|
|||
|
|||
|
I agree it looks very homework...
If you need help start by giving us the work you have done, and explain what isnt working... >The problem I have is that I dont know how to edit a text using shell scripts. there is no need of shell scripts yet... What can be used to display files in unix? (that was the first question you should be able to answer!) well : cat, more, pg-page, head tail, od... |
|
#4
|
|||
|
|||
|
Quote:
|
|||
| Google The UNIX and Linux Forums |