[Cialug] Bash Fu?

Tom Pohl tom at tcpconsulting.com
Sun Jul 11 22:26:00 CDT 2010


You could check the status of all the services set to start at your current runlevel with:

for i in /etc/rc`runlevel |awk '{print $2}'`.d/S* ; do $i status ; done

-Tom


On Jul 10, 2010, at 3:37 PM, Dave Weis wrote:

> 
> for i in /etc/rc.d/init.d/* ; do $i status ; done
> 
> Would be close.
> 
> 
>> -----Original Message-----
>> From: cialug-bounces at cialug.org 
>> [mailto:cialug-bounces at cialug.org] On Behalf Of Todd Walton
>> Sent: Saturday, July 10, 2010 3:29 PM
>> To: Central Iowa Linux Users Group
>> Subject: [Cialug] Bash Fu?
>> 
>> If one had a collection of shell scripts, all of them taking 
>> the same options, and one wanted to run each one with the 
>> same option, how would one do that?
>> 
>> Specifically, I have init scripts and I want to run "status" 
>> on each of them.
>> 
>> ./net status
>> ./ssh status
>> ./xdm status
>> 
>> ...etc
>> 
>> --
>> Todd
>> _______________________________________________
>> Cialug mailing list
>> Cialug at cialug.org
>> http://cialug.org/mailman/listinfo/cialug
>> 
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug



More information about the Cialug mailing list