![]() |
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 |
| Switch + stirng | DNAx86 | Shell Programming and Scripting | 5 | 01-09-2008 10:10 AM |
| switch login | sharif | UNIX for Advanced & Expert Users | 1 | 12-12-2007 04:03 AM |
| Switch | abey | High Level Programming | 12 | 06-27-2006 07:11 PM |
| switch from csh to ksh | veeracer | Shell Programming and Scripting | 8 | 11-05-2004 02:13 PM |
| switch from csh to ksh | veeracer | UNIX for Dummies Questions & Answers | 1 | 11-03-2004 06:28 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
hi,
i am try to run following script in c-shell, using switch command. #!/bin/csh choice=0 while [ $choice -ne 9 ] do echo "system monitor" echo " 1) system paging 2) system file inf. 3) system disk inf. 9) exit " echo "select an option: \c" read choice case $choice in 1) sar -p;; 2) sar -u;; 3) diskusage -p;; 9) ;; *) echo 'Invalid choice' sleep 1;; esac done |
|
||||
|
hi ,
this is neer45. I try to run csh switch script. but i get syntex error :- sunserver% sh monitor system monitor 1) system paging 2) system file inf. 3) system disk inf. 4) current operating system. 5) print report select an option 5 monitor: syntax error at line 12: `switch' unexpected --------------------------- thank you for your help |
|
|||||
|
First make the script executable...
chmod 755 monitor ...then change the line... read choice ...to... set choice = $< ...sorry I did not pick this up before. It has been many years since I've used csh. Do NOT use "sh monitor" to execute. Just type the script's name. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|