Results 1 to 10 of 20
Script that
-asks for a name, phone number, and date of birth and appends these details to a comma separated value file called birthday.csv
-sorts birthday.csv by birthday (not by ...
- 02-01-2010 #1Just Joined!
- Join Date
- Feb 2010
- Location
- England
- Posts
- 11
Bash Script: Need help with this !
Script that
-asks for a name, phone number, and date of birth and appends these details to a comma separated value file called birthday.csv
-sorts birthday.csv by birthday (not by age ) to produce a new file newbirthday.csv. The format of each row is:
<name>,<phoneNumber>,<YYYY/MM/DD>.
Script " bdayalarm.sh " that :
-if today it's someone’s birthday, display “Birthday Alarm” followed by rows of the name of each person whose birthday is today and their phone number, otherwise show the next birthday in the year.
If anybody could help me with that i would appreciate it...
i just got stuck and i know it's an easy script but i'm a newbye in this
Cheers!
- 02-01-2010 #2
sounds like homework. i'll give you a hint:
Then you'll need some way of putting those variables into a script, (i'd suggest using echo). That's all the help I can give ya, figure out more, if you get stumped come on back.Code:FILE=birthday.csv echo -n "Name: " read -e NAME ...
What exactly are you stuck on?
- 02-01-2010 #3Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
You should start with something at least. Even if we lay out what you need, it won't necessarily be helpful to you.
Admins of this forum will point out to you that homeworks are not allowed here, as per the forum rules.0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.
- 02-01-2010 #4Just Joined!
- Join Date
- Feb 2010
- Location
- England
- Posts
- 11
well i've done the
echo " enter your name phone etc. " part
i've named the variables ...
done the
read name
read phone etc
and when i want to put these variables into the the file .csv
it won't work using the script
cat and > or >> and ^d ... it just won't put them in the file birthday.csv
as for the ordering part i don't have an idea yet...
who said anything about homework ?
i'm 21 years old and i'm doing this linux course...i'm just trying to get used to the whole thing so i started up on some basic exercises .
P.S. i'm using pico editor via sage
right,i'm off for a jog ,hope i get some good hints/help.
talk to you in a bit .
- 02-01-2010 #5
don't use cat. use something like:
cat is more for like putting the files into STDOUTCode:echo "$NAME,$PHONE,$DOB" >> $file
A lot of people come here for "help" with scripting classes. And by help I mean they essentially want someone else to write it for them, so don't take it too personal
- 02-01-2010 #6Just Joined!
- Join Date
- Feb 2010
- Location
- England
- Posts
- 11
- 02-01-2010 #7
- 02-01-2010 #8Just Joined!
- Join Date
- Feb 2010
- Location
- England
- Posts
- 11
- 02-01-2010 #9Just Joined!
- Join Date
- Feb 2010
- Location
- England
- Posts
- 11
bump ! .
- 02-01-2010 #10
you probably wrote your script wrong, try making each input like this:
Code:echo -n "What the screen will read" read -e VARIABLENAME


Reply With Quote
