Sponsored Content
Full Discussion: simplfy
Top Forums Shell Programming and Scripting simplfy Post 302251946 by otheus on Tuesday 28th of October 2008 11:57:17 AM
Old 10-28-2008
Cool little script. It can be greatly simplified with ksh/bash/zsh. But I might also be slightly changing the behavior here.
Code:
level=`runlevel`
ls /etc/init.d/rc${level}.d/ | while read FILE
do
  FILENAME=${FILE##*/}
  if [ "${FILENAME#S}" != "$FILENAME" ]
  then
     tput smso
     echo -n $FILENAME
     tput rmso
  elif [ "${FILENAME#K}" != "$FILENAME" ]
     echo -n $FILENAME
  fi
done

 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Simplfy

I feel that i can Simplfy this but i am not fully sure how vars1=$(cat vartext | cut -d" " -f9) for word in $vars1 do var2=$(dirname $word) if ]; then ls -l $word ... (9 Replies)
Discussion started by: jafa401
9 Replies

2. Shell Programming and Scripting

Need help to Simplfy

while ]; do echo "ID format - 000-000-000" read -p "Enter Name: " usrnme read -p "Enter ID: " id if echo $usrnme | grep "^" > /dev/null then vrfy="true" else until ; do ... (2 Replies)
Discussion started by: jafa401
2 Replies
HOBBIT-NKEDIT.CGI(1)					      General Commands Manual					      HOBBIT-NKEDIT.CGI(1)

NAME
hobbit-nkedit.cgi - Xymon Critical Systems view CGI SYNOPSIS
hobbit-nkedit.cgi DESCRIPTION
hobbit-nkedit.cgi is invoked as a CGI script via the hobbit-nkedit.sh CGI wrapper. hobbit-nkedit.cgi is a web-based editor for the hobbit-nkview.cfg(5) file, which is used to configure the Xymon "Critical Systems" view. A detailed description of how to use the editor is provided in the Xymon Web documentation, available from the "Help" -> "Critical Systems" link on the Xymon website. SECURITY
Access to this CGI script should be restricted through access controls in your webserver. Editing the Critical Systems View configuration will impact the monitoring of your site. OPTIONS
--config=FILENAME Name of the Critical Systems View configuration file. The default is hobbit-nkview.cfg in the $BBHOME/etc/ directory. --env=FILENAME Loads the environment defined in FILENAME before executing the CGI script. --area=NAME Load environment variables for a specific area. NB: if used, this option must appear before any --env=FILENAME option. --debug Enables debugging output. SEE ALSO
hobbit-nkview.cgi(1), xymon(7) Xymon Version 4.2.3: 4 Feb 2009 HOBBIT-NKEDIT.CGI(1)
All times are GMT -4. The time now is 11:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy