|
|
#1 (permalink) |
|
Gold Member
![]() Join Date: Nov 2004
Age: 27
Posts: 365
|
Hi,
I need to write a basic script based on the following criteria: First of all I create a file called "script1" using the cat command and then I add a few lines to it and save it. Next, I need to write a script to do the following: a script which takes to arguments, the first being a line of text, the second being the newly created file (script1). The script should take the first argument and insert it into the very top of the file (script1) name in your seconds argument. The file must then be saved and keep its original name. This is a small part of a Java course I am doing, I am really busy with work and don't have enough time to learn the UNIX needed to complete this in time, I need to get this work emailed tomorrow. TIA Mike BTW, I am using the BASH shell and VI editor.
__________________
I do whatever my rice crispies tell me to do ;) |
|
|
|
|
|
#2 (permalink) |
|
Diamond Member
![]() Join Date: Apr 2006
Location: Inside a pc
Posts: 19,730
|
Unfortunately there is no Linux section here for real help in that direction. But I can refer you to some links with the type of information you are looking for.
http://www.tldp.org/LDP/abs/html/basic.html http://www.cactus.org/~dak/shellscript.html http://www.gnu.org/software/global/globaldoc.html http://www.ss64.com/bashsyntax/ If these don't help get you started try http://www.linuxquestions.org/questions/ |
|
|
|
|
|
#4 (permalink) |
|
Diamond Member
![]() Join Date: Apr 2006
Location: Inside a pc
Posts: 19,730
|
You will probably still have to run some more searches to get into a good onine tutorial for what you need. But these were a few good starters. I still don't have the BASH commands down yet. I loaned out the Fedora Core 4 drive for a new build a friend had put together with a ton of reference links. Here's a couple of others I can toss your way.
http://www.gnu.org/software/bash/manual/bashref.html http://www.onlamp.com/linux/cmd/ http://www.hypexr.org/bash_tutorial.php |
|
|
|