![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| passing variable from bash to perl from bash script | arsidh | Shell Programming and Scripting | 10 | 06-04-2008 12:25 PM |
| Converting bash shell to perl | freak | UNIX for Dummies Questions & Answers | 4 | 05-29-2008 12:35 AM |
| Converting Shell Script to HTML | davwel | Shell Programming and Scripting | 3 | 10-25-2007 10:25 PM |
| unix script for converting a decimal to binary | softy | Shell Programming and Scripting | 3 | 10-19-2005 09:33 AM |
| Converting an OpenVms .com to a UNIX ksh script | prosserj | Shell Programming and Scripting | 1 | 05-23-2002 01:57 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Converting bash script to csh
Hi,
I'm a beginner in scripting and I recently wrote a bash script that would've worked fine until I realized it needed to be written in csh. Could someone please show me how to correctly change the syntax from bash to csh in this script? Any help will be greatly appreciated. I can provide more details on the nature of the script if need be. #!/bin/bash print "Separating crashlist for today's date? (y/n)" read choice case $choice in y) crashlist > separate ;; n) echo "Please enter date (yyyymmdd)" read date crashlist -d $date > separate ;; esac whale () { for host in "whale-1" "whale-2" "whale-3" "whale-4" do if grep $host separate then echo echo echo "Jobs above were lost on $host" ; echo ; echo "Total hours lost:" grep $host separate | awk ' {sum += $11 }; END { print sum } ' echo echo "Number of jobs lost:" grep $host separate | awk 'END{print NR}' echo -n Press Enter to continue ; read echo else echo echo echo "No jobs lost on $host." ; echo ; echo -n Press Enter to continue ; read echo echo echo fi done } dolphin () { for host in "dolphin-1" "dolphin-2" "dolphin-3" "dolphin-4" do if grep $host separate then echo echo echo "Jobs above were lost on $host" ; echo ; echo "Total hours lost:" grep $host separate | awk ' {sum += $11 }; END { print sum } ' echo echo "Number of jobs lost:" grep $host separate | awk 'END{print NR}' echo -n Press Enter to continue ; read echo else echo echo echo "No jobs lost on $host." ; echo ; echo -n Press Enter to continue ; read echo echo echo fi done } if grep -q "whale" separate then whale else dolphin fi |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|