zhshqzyc
asked on
path to the homedirectory
Hi, I need a script for it. The script should display the path to your homedirectory and the terminal type that you are using. Additionally it shows all the services started up in runlevel 3 on your system.
Thanks for advice.
Thanks for advice.
ASKER
Everything is fine except this command.
run_level=`/sbin/runlevel | awk ' { print $2 } '`
Nothing found after running it.
ASKER
And there is a hint.
ls /etc/rc3.d/S*
But I am not sure.
You can look at the Startup scripts in /etc/rc3.d as well.
what is the output of your /sbin/runlevel?
Do you have something like:
N 3
I am puzzled at your hint? Is there a purpose behind it?
In any event whether you use chkconfig or ls /etc/rc3.d/S* it says what based on startup script should start at this level, it does not tell you that some of those that are configured to start do not because those services were not configured i.e. /etc/<servicename>/<servic ename>.con f was not created /setup
There is no reason a user logging into a system would need that type information.
what is the output of your /sbin/runlevel?
Do you have something like:
N 3
I am puzzled at your hint? Is there a purpose behind it?
In any event whether you use chkconfig or ls /etc/rc3.d/S* it says what based on startup script should start at this level, it does not tell you that some of those that are configured to start do not because those services were not configured i.e. /etc/<servicename>/<servic
There is no reason a user logging into a system would need that type information.
ASKER
It gave me
I am doing a practice problem there.
N 5
The hint is from a web tutorial. http://tille.garrels.be/training/bash/I am doing a practice problem there.
ASKER
[hzhao@localhost rc3.d]$ echo `/sbin/runlevel`N 5
[hzhao@localhost rc3.d]$ /sbin/chkconfig --list| awk ' ( $5 == "3:on") { print $1 } '
NetworkManager
abrtd
atd
auditd
avahi-daemon
bluetooth
cpuspeed
crond
cups
haldaemon
ip6tables
iptables
irqbalance
iscsi
iscsid
livesys
livesys-late
lvm2-monitor
mdmonitor
messagebus
netfs
portreserve
rsyslog
sendmail
udev-post
[hzhao@localhost rc3.d]$
N 5 means you are running in graphical mode and if you want to check the services that start at that level, you should change the $5 in the awk with $7
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Never mind, it is just a small exercise.hmm..
echo $SHELL # shell used
echo $TERM #terminal type
echo `/sbin/runlevel` #to see which runlevel your system is running.
run_level=`/sbin/runlevel | awk ' { print $2 } '`
The services that run at run level 3 can be obtained using chkconfig --list
/sbin/chkconfig --list| awk ' ( $5 == "3:on") { print $1 } '