|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Search this Thread |
|
#1
|
|||
|
|||
|
How do work c-shell? How you to write a c-shell program. I am new at unix. Please help!
|
| Sponsored Links | ||
|
|
|
#2
|
||||
|
||||
|
I would like to suggest that you are about to make a mistake. The c-shell, aka csh, is simply a terrible shell for programming. You should reconsider your choice of shells. ksh or bash would be good choices. Click here for a full discussion of why you should avoid csh.
As for getting started, I would suggest that you obtain a book about the shell and read through the book. But click here for a web site that has some introductory info. |
|
#3
|
|||
|
|||
|
Use what you are comfortable in. I learned csh first (could not find enough information at the time on the other shells) but have since done scripts in ksh and sh. Some things make more sense in each. If you are just learning, realize that most scripts (at least what I have seen) are in either sh or ksh. Look at what is used on the computers you have to deal with. If you are an admin needing to update csh scripts, then learn it. But learn the others also.
|
|
#4
|
|||
|
|||
|
Learn csh first......
I agree with "Perderabo", however csh is the default shell in about 80% of the Industrial Unix solutions. So learn it first then move on to krn,ksh,aka csh ect.
|
|
#5
|
||||
|
||||
|
Code:
names=$(awk -F: '{ if($7 == "/bin/csh") print $1 }' /etc/passwd)
for each in $names; do
mail $names << EndMail
Subject: Your shell stinks
Please change to a real shell
before I rm -r your home directory!
.
EndMail
done |
|
#6
|
|||
|
|||
|
SO Silly
Isn't it awk -F":"
|
|
#7
|
||||
|
||||
|
Yeah, that would probably be the more correct way of doing, but in this case, -F: will work.
Yeah, I may be sloppy, but how much time should I spend on a silly ol' script anyways? |
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| simple shell - how to get a parameter typed in a shell script | cmitulescu | Shell Programming and Scripting | 4 | 01-09-2009 07:45 PM |
| Linux Shell Question: how to print the shell script name ? | meili100 | UNIX for Dummies Questions & Answers | 3 | 07-01-2008 01:55 PM |
| Difference between writing Unix Shell script and AIX Shell Scripts | haroonec | AIX | 0 | 04-12-2006 02:27 AM |
| How to run unix commands in a new shell inside a shell script? | hkapil | Shell Programming and Scripting | 2 | 01-04-2006 05:56 AM |
| how to convert from korn shell to normal shell with this code? | forevercalz | Shell Programming and Scripting | 21 | 11-23-2005 01:18 AM |