![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can't login root account due to can't find root shell | neikel | AIX | 2 | 01-30-2008 08:07 PM |
| how to access root priveliges if root password is lost | wojtyla | Linux | 1 | 02-18-2005 03:24 AM |
| Run non-root script as root with non-root environment | bubba112557 | UNIX for Dummies Questions & Answers | 2 | 12-02-2004 09:39 PM |
| Lost root password / Can't login as root | Perderabo | Answers to Frequently Asked Questions | 0 | 06-22-2004 04:40 PM |
| fsstat: root file system needs checking | mbco | UNIX for Dummies Questions & Answers | 0 | 04-26-2004 01:58 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Checking ~ Root
Dear,
How actually we can using a sh script to check weather we are in root or user? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
try the command
#whoami |
|
#3
|
|||
|
|||
|
if ! id | grep -q "uid=0(root)" ; then
print "ERROR: must be root in order to run this script fi |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|