ComputerForum.com ComputerForum.com  
TigerDirect
 
Go Back   Computer Forum > Computer Software > Operating Systems

Reply
 
LinkBack Thread Tools Display Modes
Old 05-25-2006, 10:20 PM   #1 (permalink)
Gold Member
 
Join Date: Nov 2004
Age: 27
Posts: 365
Default Help with UNIX/Linux script

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 ;)
mikekelly is offline   Reply With Quote


Old 05-25-2006, 10:30 PM   #2 (permalink)
Diamond Member
 
PC eye's Avatar
 
Join Date: Apr 2006
Location: Inside a pc
Posts: 19,730
Default

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/
PC eye is offline   Reply With Quote
Old 05-25-2006, 10:36 PM   #3 (permalink)
Gold Member
 
Join Date: Nov 2004
Age: 27
Posts: 365
Default

Thanks a lot!!
__________________
I do whatever my rice crispies tell me to do ;)
mikekelly is offline   Reply With Quote
Old 05-25-2006, 11:31 PM   #4 (permalink)
Diamond Member
 
PC eye's Avatar
 
Join Date: Apr 2006
Location: Inside a pc
Posts: 19,730
Default

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
PC eye is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:35 AM.


Powered by: vBulletin Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright © 2002-2008 Computer Forum and Web Design Forum