10-05-2004
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!
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
2. UNIX for Dummies Questions & Answers
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
3. AIX
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
4. Shell Programming and Scripting
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
5. UNIX for Dummies Questions & Answers
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. Red Hat
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
7. UNIX for Dummies Questions & Answers
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
8. IP Networking
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
9. Shell Programming and Scripting
lllll (34 Replies)
Discussion started by: risarose87
34 Replies
LEARN ABOUT OPENSOLARIS
script
script(1) User Commands script(1)
NAME
script - make record of a terminal session
SYNOPSIS
script [-a] [filename]
DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the
record is saved in the file typescript. See WARNINGS.
The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends
when the forked shell exits or when Control-d is typed.
OPTIONS
The following option is supported:
-a Appends the session record to filename, rather than overwriting it.
NOTES
script places everything that appears on the screen in filename, including prompts.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
SEE ALSO
attributes(5)
WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a
privileged user, that is, root. Be sure that typescript is not a link before running script.
SunOS 5.11 30 Jan 2004 script(1)