|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions. |
![]() |
|
|
Search this Thread |
|
#1
|
|||
|
|||
|
identifying SU mode by shell script
the following bash script is not working in fedora-11 Could anyone help me please? Code:
#!/bin/bash
if
[$[`id -u`] -ne 0];then
echo " you are in root"
else echo " you must be in root -su mode??"
fi
exitLast edited by Franklin52; 03-14-2010 at 07:50 AM.. Reason: Please use code tags! |
| Sponsored Links | ||
|
|
|
#2
|
|||
|
|||
|
Quote:
Code:
if [$[`id -u`] -ne 0] with: Code:
if [ $(id -u) -ne 0 ] Be aware of the spaces around the square brackets. |
|
#3
|
|||
|
|||
|
Thanks Franklin very much..........
|
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Vi Mode of Shell Not Starting | almond | UNIX for Advanced & Expert Users | 4 | 06-22-2009 04:58 AM |
| Convet Linux OS from text mode to graphic mode | s_linux | SuSE | 6 | 02-07-2009 10:18 PM |
| Identifying prior date in shell script | royalibrahim | Shell Programming and Scripting | 5 | 12-04-2008 08:38 AM |
| Script to ftp in non-ineractive mode | mshv123 | Shell Programming and Scripting | 6 | 09-18-2007 05:45 PM |
| How to run shell script in silent mode | x057373 | UNIX for Dummies Questions & Answers | 3 | 12-04-2005 07:26 PM |