![]() |
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 |
| 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl cgi script to call bash script? | pleonard | Shell Programming and Scripting | 0 | 06-02-2009 01:57 PM |
| Bash script: issue changing directories in script | Breakology | Shell Programming and Scripting | 5 | 05-26-2009 08:47 AM |
| how to make your bash script run on a machine with csh and bash | npatwardhan | Shell Programming and Scripting | 3 | 11-19-2008 04:17 AM |
| passing variable from bash to perl from bash script | arsidh | Shell Programming and Scripting | 10 | 06-04-2008 12:25 PM |
| Why generate "ash and bash" different output for same bash script? | s. murat | Shell Programming and Scripting | 0 | 05-26-2008 07:19 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
script in Bash 2.05b.0(1) and 3.2.25(1) Red Hat
Hi
I have this script #!/bin/bash cat status.txt | while read LINE do linija="$LINE" echo $linija echo $linija | awk '{print $1}' > temp.txt koj=`tail -1 temp.txt` echo $koj echo $linija | awk '{print $2}' > temp1.txt kolku=`tail -1 temp1.txt` vkupno=$(( vkupno + kolku )) echo $kolku echo $vkupno > vkupno_temp.txt done kolku_vkupno=`tail -1 vkupno_temp.txt` echo $kolku_vkupno and its working perfectly in 2.05b.0(1) bash called with ksh and bash But in 3.2.25(1) version of bash only the first line of status.txt passes. Then (on the second line of the file status.txt) i get this error : arithmetic syntax error on this line vkupno=$(( vkupno + kolku )). Can someone pls help. What should i change in the script to work in new bash. Thanks in advance P.S. status.txt consists of lines : sometext 4 another text 12 and so on |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|