- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- If sentence ..
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2005 02:57 AM
тАО12-14-2005 02:57 AM
how cay i use if to indicate a sentence:
if $a (is bigger than) $b
then ...
"is bigger than" how can i indicate it in if sentence? is like -ge? is like -aq? what is, i don't remember it ...!!!
Thanks, Manuales.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2005 03:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2005 03:02 AM
тАО12-14-2005 03:02 AM
Re: If sentence ..
if [ $a -gt $b ]
then
...
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2005 03:02 AM
тАО12-14-2005 03:02 AM
Re: If sentence ..
if you type man test it will show some useful syntax.
- Tags:
- Test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2005 03:02 AM
тАО12-14-2005 03:02 AM
Re: If sentence ..
if test $a ...... Bb
whad do you put in space "...." ?
Tnanks, Manuales.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2005 03:04 AM
тАО12-14-2005 03:04 AM
Re: If sentence ..
for strings:
"=" equal
"!=" not equal
for numbers:
"-eq" equal
"-ne" not equal
"-gt" greater than
"-lt" less than
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2005 03:07 AM
тАО12-14-2005 03:07 AM
Re: If sentence ..
I assume that you want the Posix (or 'ksh') shell syntax.
If so, see the man pages for 'test' and the man pages for 'sh-posix'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2005 03:10 AM
тАО12-14-2005 03:10 AM
Re: If sentence ..
#!/usr/bin/ksh
a="A"
b="B"
if [[ "$a" > "$b" ]]
then
echo a greater than b
else
echo a not greater than b
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2005 03:14 AM
тАО12-14-2005 03:14 AM
Re: If sentence ..
A review of "man test" and "man ksh" will explain the differences.
For instance-
if [ ab = a* ]... is false since it is a string compare, whereas
if [[ ab = a* ]]... is true since it is doing a pattern match.
read the "man" pages for the details...
Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2005 06:03 AM
тАО12-14-2005 06:03 AM
Re: If sentence ..
why do i have next error?
serverunix:girl1 279> prueba.csh
if: Expression syntax.
my script is:
if ($bb = 1)
then
echo "hola"
else
echo "adios"
eif
why is the problem??
Thanks, Manuales.
- Tags:
- csh