![]() |
|
|
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 |
| Development Releases: Linux Mint 4.0 Beta "Fluxbox", 4.0 Alpha "Debian" | iBot | UNIX and Linux RSS News | 0 | 01-04-2008 03:00 PM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-20-2007 01:52 AM |
| grep to find content in between curly braces, "{" and "}," | keshav_rk | Shell Programming and Scripting | 4 | 08-09-2007 11:14 PM |
| how could i make a program mixed with many "|", "<" and ">" | strugglingman | High Level Programming | 2 | 04-29-2006 09:11 AM |
| No utpmx entry: you must exec "login" from lowest level "shell" | peterpan | UNIX for Dummies Questions & Answers | 0 | 01-18-2006 04:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
if does not want to take "OR"?
I am confused now, I have the following simple script which reads 2 numbers from file test, and if any of these two numbers is bigger than 200, it prints biggest, bigger than 100, it prints medium, and smaller than 100, it prints "small number",
My question is, why if does not want to take this "-a" option? I get the following error "[: bb: integer expression expected" #/bin/bash while read aa bb do if [ "$aa" -gt "200" -a "bb" -gt "200" ]; then echo "biggest" elif [ "$aa" -gt "100" -a "bb" -gt "100" ]; then echo "medium number" else echo "small number" fi done < /tmp/test |
|
||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|