![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Appending a line in a file after a particular line | maxvirrozeito | Shell Programming and Scripting | 7 | 12-12-2007 01:58 PM |
| Appending line ending with '}" to new line | aismann | Shell Programming and Scripting | 4 | 08-13-2007 03:09 AM |
| Sed - Appending a line with a variable on it | eltinator | Shell Programming and Scripting | 4 | 07-30-2007 10:15 AM |
| Appending the line number and a seperator to each line of a file ? | pjcwhite | Shell Programming and Scripting | 4 | 03-21-2007 01:29 AM |
| Appending line/lines with sed | nir_s | Shell Programming and Scripting | 28 | 07-24-2005 03:36 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Appending to the first line of a document
Hi all, I'm new to the forums and a total beginner with Unix. I've been given the seemingly simple task of writing a script that asks for two arguments: the first argument being a line of text, the second argument being a document. The script has to take the first argument of text and append it to the specified document in the second argument (no problem), but then the text must be appended to the first line of the document (without using SED or AWK) and I'm confused as to what command I use to do this.
I thought one way around this would be to CAT the first arg and then the second, then save the output to the file noted in the second arg, but because the input and output sources are the same in the second arg, shell doesnt want to know. I have a feeling there is something so simple that I'm missing, but going back over my notes, I can't seem to find what it is that I should know here? Any thoughts? Perhaps there some way to run VI or EX commands from the shell so that I can paste the input from the first arg into the specified document? Would really appreciate some advice here! Many thanks. |
| Bookmarks |
| Tags |
| unix commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|