totally new to unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers totally new to unix
# 1  
Old 10-05-2004
Network totally new to unix

I'm trying to write a script, named "worfo" which will read a file in and return, on the screen, the number of words in the file. Also, I am looking to do several extras with this script. I need to allow it to accept the option "-n" which will use all non-alpha characters to delimit words. Also, accept the option "-u" which will count only unique words. I have never wrote a UNIX script before, and I am looking for some tips on how to actually format this. I have used "pico worfo" to start editing my script and have "wc $1" but I am not sure of the format as to how to set up a script. Any input and suggestions are greatly appreciated!
adawg1283
# 2  
Old 10-05-2004
Here is a common script stub. Search the boards for example scripts. Try searching for keywords such as getopts, wc, cat, echo and see what you find. Most importantly, read the rules. Make certain that you are not posting homework questions. The question you asked smells of homework.

Code:
#!/usr/bin/ksh
#
# SCRIPT: NAME_of_SCRIPT
# AUTHOR: AUTHORS_NAME
# DATE:   DATE_of_CREATION
# REV:    1.1.A (Valid are A, B, D, T and P)
#               (For Alpha, Beta, Dev, Test and Production)
#
# PLATFORM: (SPECIFY: AIX, HP-UX, Linux, Solaris 
#                      or Not platform dependent)
#
# PURPOSE: Give a clear, and if necessary, long, description of the
#          purpose of the shell script. This will also help you stay
#          focused on the task at hand.
#
# REV LIST:
#        DATE: DATE_of_REVISION
#        BY:	  AUTHOR_of_MODIFICATION   
#        MODIFICATION: Describe what was modified, new features, etc-
#
#
# set -n   # Uncomment to check your syntax, without execution.
#          # NOTE: Do not forget to put the comment back in or
#          #       the shell script will not execute!
# set -x   # Uncomment to debug this shell script (Korn shell only)
#          
##########################################################
########### DEFINE FILES AND VARIABLES HERE ##############
##########################################################



##########################################################
############### DEFINE FUNCTIONS HERE ####################
##########################################################



##########################################################
################ BEGINNING OF MAIN #######################
##########################################################



# End of script

# 3  
Old 10-05-2004
You were warned about homework in this thread. Believe it or not, the rules do apply to you.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Totally new to shell scripting

lllll (34 Replies)
Discussion started by: risarose87
34 Replies

2. IP Networking

Totally stucked in ssh port forwarding

Hello my friends , i am totally stuck in ssh port forwarding topic i had learn iptables and other networking topic without any problem but ssh port forwarding is headache 1. local port = what is this ? is this incoming traffic or outgoing traffic 2. remote port = same as above 3. dynamic... (2 Replies)
Discussion started by: rink
2 Replies

3. UNIX for Dummies Questions & Answers

massive tarred grib files totally unacceptable

Hi, I have 7 terabytes of tar files, one for every single day since 1980. Inside these tar files are GRIB files, each with 100+ variables. There's 8 GRIBs in each tar, corresponding to different times of the day. I need 6 friggin variables..., and it takes TWO WEEKS TO EXTRACT ALL THE TAR FILES... (3 Replies)
Discussion started by: sammysoil
3 Replies

4. Red Hat

comm: mysqld Not tainted ... Kernel Panic , System totally unresponsive

Hi, I am experiencing frequent system hangs, hard kernel panics, etc almost thrice a day. The system would be totally unresponsive and the only way is to reboot is hard power recycling (plug out the power cable and plug in back after 30 secs). I enabled kdump, but unfortunately the kdump files... (3 Replies)
Discussion started by: massoo
3 Replies

5. UNIX for Dummies Questions & Answers

Totally brand new to CRON

hi there i am very new to the world of CRON. i would like to know from below the ground up how i can learn abouot cron. where the best tutorials lie. i have an assignment that requires i set up a cron job to download a price file. am i in control of where the price file is downloaded to? (eg to... (2 Replies)
Discussion started by: buzzby
2 Replies

6. Shell Programming and Scripting

Sed if statement (totally stuck) apache

I have a irritating problem with a "if"-statement or what you should call it, in sed. I would love some help here since I am very, very stuck. I have this statement that I want to do: if line contains a: do this if none of the lines contained a: do this The problem with this... (8 Replies)
Discussion started by: hjalle
8 Replies

7. AIX

Totally messed up

I have moved the etc/passwd file and we are now unable to get in to Unix - any suggestions? (2 Replies)
Discussion started by: vbagwell
2 Replies

8. UNIX for Dummies Questions & Answers

Suggestion: Alternative OS for Windows - Totally Clueless on Unix/Linux OS

Can anyone tell me a good alternative to Windows? OS that can connect to a Windows domain and use for everyday (can use with Oracle). Easy to learn. (4 Replies)
Discussion started by: genesisX
4 Replies

9. UNIX for Dummies Questions & Answers

Totally new unix user

Hi, ive just been given a HP UX c180 to play with, along with a few external hd`s, can anyone recommend me a good place to start learning unix please as i havent got a clue what im doing when it comes to unix. Either web links or book recomendations would be great. I would like to set it up with... (1 Reply)
Discussion started by: Leviathan40
1 Replies
Login or Register to Ask a Question