Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
google site



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Search this Thread
  #1  
Old 01-18-2002
Registered User
 

Join Date: Jan 2002
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Cool c-shell

How do work c-shell? How you to write a c-shell program. I am new at unix. Please help!
Sponsored Links
  #2  
Old 01-18-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,147
Thanks: 0
Thanked 13 Times in 12 Posts
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  
Old 01-23-2002
thehoghunter
Guest
 

Posts: n/a
Bits: 0 [Banking]
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  
Old 01-25-2002
Registered User
 

Join Date: Sep 2001
Location: Switzerland
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
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  
Old 01-25-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Thanks: 0
Thanked 1 Time in 1 Post

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  
Old 01-25-2002
Registered User
 

Join Date: Sep 2001
Location: Switzerland
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
SO Silly

Isn't it awk -F":"
  #7  
Old 01-25-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Thanks: 0
Thanked 1 Time in 1 Post
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
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are Off


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



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