![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| arithmetic in tcsh | gobi | Shell Programming and Scripting | 4 | 05-28-2008 06:05 PM |
| Can I use wc -l with arithmetic expression? | lalelle | Shell Programming and Scripting | 3 | 08-11-2007 03:44 PM |
| arithmetic in ksh | amon | Shell Programming and Scripting | 12 | 02-04-2007 11:43 PM |
| Arithmetic In UNIX | tygun | UNIX for Dummies Questions & Answers | 3 | 11-23-2005 02:46 PM |
| arithmetic problem | inquirer | UNIX for Dummies Questions & Answers | 2 | 02-19-2002 11:27 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
arithmetic syntax
okay, I'm a complete beginner, and I keep getting stuck on the syntax here. I want to write a script where I read the current time as minutes and seconds, convert the minutes to seconds, and add the two, then redirect the output to a file. the command takes two arguments, which will also be redirected to the file. This is what I have:
echo $1: $2: >> tmk set min=`date +%M` set sec=`date +%S` set total=`($min * 60) + $sec` echo $total >> tmk I keep getting a badly placed bracket error on the set total line. Any suggestions? I want to be able to use the script to input a number of times, then add or subtract them depending on the first two arguments at a later time. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Looks like csh - try @ total = ($min * 60) + $sec
|
||||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|