Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 20th, 2004, 8:31 AM   #1
panabook
Newbie
 
Join Date: Jul 2004
Posts: 4
Rep Power: 0 panabook is on a distinguished road
can someone help me with these problems.

the file class.txt contains the computer login and student number of the students in a class. other information also appears on each lin of the file. items are separated from each other by spaces. of all the items on any line, only the student number is 8 digits and only the computer login is alphanumeric characters followed by two digits.
it is guaranteed that the login appears before the number on any line. i need a shell command using sed that generates the file names.dat that contains lines with just student number and the login separated by one space.

write a shell script that takes data from standard input, and reports the number of lines that begin with a #, and the number of words seen. a word is anything delimited by whitespace
panabook is offline   Reply With Quote
Old Jul 20th, 2004, 9:56 AM   #2
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Since this is another homework problem of yours... I need to see what you can come up with first, at least make an effort to solve the problem. You can type
'man sed' at the prompt for a good start.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Jul 20th, 2004, 1:21 PM   #3
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Is this on a linux/unix system or a winblows system?

-Pizentios
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Jul 20th, 2004, 8:08 PM   #4
panabook
Newbie
 
Join Date: Jul 2004
Posts: 4
Rep Power: 0 panabook is on a distinguished road
once again i have an exam tomorrow and i cant seem to answer these specific questions which are in past exam papers. i have alot of content to study and am just trying to get things done quicker.
this is on a unix system
i would not normally post these types of questions on a forum but i thought it was the best possible option in such a short manner on time
panabook is offline   Reply With Quote
Old Jul 20th, 2004, 11:26 PM   #5
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
I would assume linux since that is where most BASH scripting is done
__________________
Clifford Matthew Roche &lt;geek@cliffordroche.com&gt;
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old Jul 21st, 2004, 8:01 AM   #6
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Quote:
I would assume linux since that is where most BASH scripting is done
I write Bash scripts in Solaris as well as Gentoo Linux

Quote:
just trying to get things done quicker
Let me know if you still have problems with this after you run the 'man sed' command and try it out first.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Jul 21st, 2004, 8:49 AM   #7
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Quote:
I would assume linux since that is where most BASH scripting is done
Yeah but notice the forum title? BASH/Shell Scripting. Also note that there are several different types of shells.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Jul 21st, 2004, 2:19 PM   #8
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
I wonder how the "test" went?
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Jul 21st, 2004, 4:34 PM   #9
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
yeah...me too, although he never replyed weather or not the man sed helped him or not.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Jul 21st, 2004, 4:38 PM   #10
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
I guess he wanted us to do it for him. lol maybe if he fails a few times he will learn to stop procrastinating.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC