![]() |
|
|
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 shell script from perl cgi script problem | raksha.s | Shell Programming and Scripting | 2 | 03-25-2009 04:50 AM |
| ssh script problem problem | pcjandyala | Shell Programming and Scripting | 2 | 07-31-2008 04:27 PM |
| FTP script and problem | lawadm1 | Shell Programming and Scripting | 1 | 06-18-2007 06:44 PM |
| Problem starting a script from a 'main'-script | Rakker | UNIX for Dummies Questions & Answers | 3 | 06-28-2005 09:12 AM |
| Script problem | danyxti667 | UNIX for Dummies Questions & Answers | 2 | 02-11-2005 02:01 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi, I am making a shell script but getting the errors. Script is Code:
#!/bin/bash ls /var/cpanel/users > /home/users.txt for i in `cat /home/users.txt` do grep -H PLAN /var/cpanel/users/$i | cut -f2 -d= > /root/oldpkg.txt oldpkg=`cat /root/oldpkg.txt` echo "Old package is $oldpkg" du -kcs /home/$i | cut -f1 > /root/usage.txt usage=`cat /root/usage.txt` echo $usage numusage=$(`expr $usage`) echo " usage is $numusage" if [ "$usage" -lt 50000 ] then newpkg="less that 50000 k" echo $newpkg fi if [ "$usage" -gt 50000 ] then newpkg="greater that 50000 k" echo $newpkg fi done The output I get is Code:
Old package is nolimit 6776 6776 expr: syntax error usage is account.sh: line 26: [: 6776 6776: integer expression expected account.sh: line 33: [: 6776 6776: integer expression expected Old package is nolimit 280 280 expr: syntax error usage is account.sh: line 26: [: 280 280: integer expression expected account.sh: line 33: [: 280 280: integer expression expected Old package is nolimit 576 576 expr: syntax error usage is account.sh: line 26: [: 576 576: integer expression expected account.sh: line 33: [: 576 576: integer expression expected Old package is nolimit Please help me out. Thanks in advance |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|