The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. Shell Script Page.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ksh scripting help praveenbvarrier Shell Programming and Scripting 1 04-15-2008 07:19 AM
sql scripting help sam786 Shell Programming and Scripting 3 12-10-2007 08:31 AM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 05:12 AM
scripting guru's pls help me with scripting on AIX thatiprashant Shell Programming and Scripting 1 01-20-2006 03:58 PM
Scripting? woofie What's on Your Mind? 1 03-09-2005 03:03 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-28-2004
adawg1283
Guest
 

Posts: n/a
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Unhappy HELP! Need HELP scripting!

HELP! I have to write a basic UNIX shell that will read in a file, and print out the number of words in the file. I need to create a system that will take a file and output information to standard out (the screen) about the number of words in a file. A word is defined as characters delineated by standard white spaces. I have to have a "driving" shell script named worfo and will use system commands and utilities. Also, my system has to do the following extra's:

Accept the option -n, meaning to use all non-alpha characters to delimit words

Accept the option -u, meaning to only count unique words

I am having problems starting out on how to do this! Any advice and help is GREATLY appreciated!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-29-2004
adawg1283
Guest
 

Posts: n/a
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Unhappy need help scripting!

HELP! I have to write a basic UNIX shell that will read in a file, and print out the number of words in the file. I need to create a system that will take a file and output information to standard out (the screen) about the number of words in a file. A word is defined as characters delineated by standard white spaces. I have to have a "driving" shell script named worfo and will use system commands and utilities. Also, my system has to do the following extra's:

Accept the option -n, meaning to use all non-alpha characters to delimit words

Accept the option -u, meaning to only count unique words

I am having problems starting out on how to do this! Any advice and help is GREATLY appreciated!
Reply With Quote
  #3 (permalink)  
Old 09-29-2004
Registered User
 

Join Date: Sep 2004
Posts: 78
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Arrow search in the forum

to sum it up - read file, word count, read input, make case loop....I mean, the whole soultion is here in the forum. You only have to search. first try then ask.....
Reply With Quote
  #4 (permalink)  
Old 09-29-2004
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,289
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
This sounds like a mid-level college CS course assignment.
We don't give homework answers, but the the source code for 6494 different shells is at:

http://freshmeat.net/browse/164/
Reply With Quote
  #5 (permalink)  
Old 09-29-2004
adawg1283
Guest
 

Posts: n/a
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Unhappy

Yes, this is a college assignment, and I'm not looking for actual code. Just how to go about starting it off because I have NO idea!
Reply With Quote
  #6 (permalink)  
Old 09-29-2004
Registered User
 

Join Date: Jul 2004
Location: New York State
Posts: 65
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
check out the utility wc. And thats all the help you get.
Reply With Quote
  #7 (permalink)  
Old 09-29-2004
auswipe's Avatar
Registered User
 

Join Date: Nov 2001
Location: Wide Awake Wylie, Texas
Posts: 536
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
This smells a lot like homework...
__________________
Not quite as cool as all the other Kids...
Reply With Quote
  #8 (permalink)  
Old 09-29-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,252
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Please read our rules

note in particular:

(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly.

(6) Do not post classroom or homework problems.

I have combined your two threads. For posterity, the title of the other thread was "need help scripting!".

It looks like you started the second one after admitting in the first thread that this was a class assignment. If this assignment is too difficult for you, then you need to discuss that with your instructor.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash for loop boot: cannot open kernel/sparcv9/unix command copy/move folder in unix curses.h cut command in unix daemon process find grep find mtime find null character in a unix file from ip can we get machine name +unix glance unix grep multiple lines grep or grep recursive how to redirect console logs in unix inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime perl array length ping port remove first character from string in k shell replace space by comma , perl script scp recursive segmentation fault(coredump) sftp script snoop unix stale nfs file handle syn_sent tar exclude tar extract to folder unix unix .profile unix forum unix forums unix internals unix interview questions unix mtime unix simulator unix.com vi substitute while loop within while loop shell script


All times are GMT -7. The time now is 11:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101