Finding your current run lvl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Finding your current run lvl
# 1  
Old 09-08-2005
Finding your current run lvl

The title says it all really. I am writing a shell script for a Linux box, and I have recently run into a problem. I need to make sure I am at a certain run level first.

Hence, the question. How can I find out what run level the box is currently running at?

Is there a system variable that I've overlooked or don't know about that I can use?

Please help me as soon as possible with this, as I am trying to finish this script by today. Thanks!...........SN
# 2  
Old 09-08-2005
from the command line, run: who -r
# 3  
Old 09-08-2005
Okay I see. Thanks.

Do you know how I could strip the date that it outputs along with it? I looked at the man page and it doesn't give an option for striping the date...........SN


EDIT: Nevermind, I was able to figure out a way. Thanks for the help!

Last edited by Scripting Newb; 09-08-2005 at 01:01 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Current shell session hungs when run another binary

Hi, I am on AIX 7.1 and when I try to login to my account and sudo to other generic account (mqm user) my ssh session just hungs. ================== $ id uid=16150(sxp) gid=179(rax) groups=1179(raxs) $ $ $ sudo su - mqm Password: -------- Changed username to: mqm -------- .... (1 Reply)
Discussion started by: bdpl
1 Replies

2. Shell Programming and Scripting

Finding 4 current files having specific File Name pattern

Hi All, I am trying to find 4 latest files inside one folder having following File Name pattern and store them into 4 different variables and then use for processing in my shell script. File name is fixed length. 1) Each file starts with = ABCJmdmfbsjop letters + 7 Digit Number... (6 Replies)
Discussion started by: lancesunny
6 Replies

3. Red Hat

syslog configuration and log lvl

Hello I was getting hammered in /var/log/messages from snmpd becouse it was running a jira which was sending email everytime someone updated a case or made any changes. Therefor I decided to turn down the loglvl of snmpd, so what I did was add snmpd.notice; to # cat /etc/syslog.conf # Log... (2 Replies)
Discussion started by: chipmunken
2 Replies

4. Shell Programming and Scripting

Finding files in current directory when 100,000's files in current directory

Hi All I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age. I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Discussion started by: kewong007
2 Replies

5. Shell Programming and Scripting

Finding files older than the current date and time and renaming and moving

Hi, I have a very urgent requirement here. I have to find all files in the specified directory but not in the sub directories(The directory name is stored in a variable) which are older than the current date as well as current time and rename it as filename_yyyymmddhhmmss.ext and move it into a... (7 Replies)
Discussion started by: ragavhere
7 Replies

6. Shell Programming and Scripting

finding 0 byte files in current directory only

Hi Gurus, I have a directory A, which has some 0 byte files in it. This directory also has a subdirectory B which also has some 0 byte files in it. The problem: I only need to find out the names of the 0 byte files in the directory A. I'm using the following command find . -name *.zip... (6 Replies)
Discussion started by: ramky79
6 Replies

7. AIX

finding original login name, not current name

Hi all, I've searched around and not found any specific solution to my problem, so wondered if someone out there could help. I'm in the process of migrating some shell scripts from HP UNIX to AIX and one of the scripts uses the 'logname' command. On HP 'logname' returns the login name,... (8 Replies)
Discussion started by: Boothy
8 Replies

8. Programming

Finding largest file in current directory?

I was hoping to get some assistance with this C program I am working on. The goal is to find the largest file in the current directory and then display this filename along with the filesize. What I have so far will display all the files in the current directory. But, how do I deal with "grabbing"... (1 Reply)
Discussion started by: AusTex
1 Replies

9. UNIX for Dummies Questions & Answers

Finding out the current AIX Maintenance Level

Is there a simple command in the vein of `oslevel` under AIX 4.3 to show the current patch level of the machine? (2 Replies)
Discussion started by: sam_pointer
2 Replies

10. UNIX for Dummies Questions & Answers

Finding current working dir path

Hi Folks, In a Unix (ksh) script, is there a way to determine the current working directory path of another logged-in user? Of course, I can use "pwd" to find my own path. But, how do I find it for another active user? Thanks for any input you can provide. LY (6 Replies)
Discussion started by: liteyear18
6 Replies
Login or Register to Ask a Question