The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 11-04-2007
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,633
Ok, this looks like homework, so i won't solve that for you, but will give you some hints on how you can find the answer. Note however, that asking questions regarding homework assignments is generally forbidden here so you are already on a very narrow path with your question:

Consider you have you file, the content could look like

Quote:
abc first
abc second
123 third
you have probably created it using vi or some other text editor, but which UNIX command do you use to display a file?

How you get parameters from the command line into your script is part of every shell manpage, so i won't tell you here how this is done. Consider, your line is

Quote:
this is my command line
your desired result would then be

Quote:
this is my command line
abc first
abc second
123 third
You sure have heard about output redirection, yes? If not, study your book again. You'll find your answer there along with everything you need to create your script.

bakunin