Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Closed Thread
  Search this Thread
Old 12-20-2004, 12:01 AM   #1
LQ Newbie
Registered: Dec 2004
Posts: 2

Rep: Reputation: 0
writing my first shell script

ok, never done shells before,

i have to design and implement a script that provides line numbered contents of a file.

i must make use of the following:

#control structures
#command line arguments

the display of the line numbered contents of the file should be prefaced with the current date and time.
the script should also set the PATH enviroment variable back to its default at the end of the script.

any pointers hints tips would be much appreciated

thank you very much
Old 12-20-2004, 12:40 AM   #2
LQ Guru
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
This sounds suspiciously like school homework

If so, my suggestion is to ask your teacher for help. If s/he didn't provide you with the necessary resources to do this assignment, then you should ask for assistance from them.

If this is not homework, then perhaps you could elaborate a bit: does the date/time need to be printed before every line of output, or just at the beginning? And how is it that the PATH environment variable would change during the course of this script?
Old 12-20-2004, 01:17 AM   #3
LQ Newbie
Registered: Dec 2004
Posts: 2

Original Poster
Rep: Reputation: 0
date & time only once, & then display of line numbered contents

Old 12-20-2004, 01:36 AM   #4
Senior Member
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 56
Old 12-20-2004, 01:50 AM   #5
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,047
Blog Entries: 11

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Sounds like homework to me, too ... please do not post homework
questions here as per the rules that you accepted when you
signed up.


Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Writing a shell script mattz40 Debian 5 04-13-2005 07:56 PM
writing a shell script tchoua Linux - General 8 02-24-2005 07:18 PM
shell script writing ust Linux - General 6 01-24-2005 02:06 PM
help writing shell script np complete Linux - Newbie 6 08-30-2004 10:43 PM
Need Help in Writing a Shell Script. KptnKrill Linux - General 2 05-19-2003 06:44 AM

All times are GMT -5. The time now is 09:15 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration