![]() |
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 |
| Call C Program From Shell Script | Chanakya.m | Shell Programming and Scripting | 4 | 01-22-2009 12:14 AM |
| please convert the below program into shell script | mail2sant | Shell Programming and Scripting | 3 | 04-10-2008 08:39 AM |
| want to run different files under the same program using shell script | cdfd123 | Shell Programming and Scripting | 3 | 10-04-2007 03:27 AM |
| Calling SHELL script from C program | Chanakya.m | Shell Programming and Scripting | 7 | 09-21-2007 08:34 PM |
| shell script program | jayaram_miryabb | Filesystems, Disks and Memory | 1 | 03-09-2005 08:12 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need help on C-shell script program
#!/bin/csh
# This program will add integers # # # add integer1 .. # # Check for argument if ($#argv == 0 ) then echo "usage: add integers" exit 1 else set input = $argv[*] endif # set sum = 0 foreach var ( $input ) @sum = $sum + $input end # echo "The sum total of the integers is $sum" # exit 0 # Hi I am trying to make a program that adds all integers that are input. ex. add 2 sum = 2 add 2 4 10 sum = 16 This is what i have for code but i keep getting the error "add: syntax error at line 18: `(' unexpected". If anyone could help me fix it i would appreciate it. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|