what is shell scripting

#!/bin/bash 
 
# Name: Check for domain name availability 
# linuxconfig.org 
# Please copy, share, redistribute and improve 
 
if [ "$#" == "0" ]; then 
    echo "You need tu supply at least one argument!" 
    exit 1
fi 
 
DOMAINS=( '.com' '.co.uk' '.net' '.info' '.mobi' \ 
'.org' '.tel' '.biz' '.tv' '.cc' '.eu' '.ru' \ 
'.in' '.it' '.sk' '.com.au' )
 
ELEMENTS=${#DOMAINS[@]} 
 
while (( "$#" )); do 
 
  for (( i=0;i<$ELEMENTS;i++)); do 
      whois $1${DOMAINS[${i}]} | egrep -q \ 
      '^No match|^NOT FOUND|^Not fo|AVAILABLE|^No Data Fou|has not been regi|No entri' 
	  if [ $? -eq 0 ]; then 
	      echo "$1${DOMAINS[${i}]} : available" 
	  fi 
  done 
 
shift 
 
done

0
2
SpaTown 115 points

                                    #!/bin/sh
# Shell Script to start / stop PHP FastCGI using lighttpd - spawn-fcgi binary file.
# -------------------------------------------------------------------------
# Copyright (c) 2006 nixCraft project &lt;http://cyberciti.biz/fb/&gt;
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
PROVIDES=php-cgi
LIGHTTPD_FCGI=/usr/local/bin/spawn-fcgi 
SERVER_IP=127.0.0.1
SERVER_PORT=9000 
SERVER_USER=www
SERVER_GROUP=www 
PHP_CGI=/usr/local/bin/php-cgi
PGREP=/bin/pgrep
KILLALL=/usr/bin/killall
### No editing below ####
cmd=$1
&nbsp;
pcgi_start(){
  	echo &quot;Starting $PROVIDES...&quot;
 	$LIGHTTPD_FCGI -a $SERVER_IP -p $SERVER_PORT -u $SERVER_USER -g $SERVER_GROUP -f $PHP_CGI
}
&nbsp;
pcgi_stop(){
	echo &quot;Killing $PROVIDES...&quot;
	$KILLALL $PROVIDES
}
&nbsp;
pcgi_restart(){
	pcgi_stop
	pcgi_start
}
&nbsp;
pcgi_status(){
        $PGREP $PROVIDES &gt; /dev/null
	[ $? -eq 0  ] &amp;&amp; echo &quot;$PROVIDES running&quot; || echo &quot;$PROVIDES NOT running&quot; 
&nbsp;
}
&nbsp;
pcgi_help(){
  	echo &quot;Usage: $0 {start|stop|restart|status}&quot;
}
&nbsp;
&nbsp;
case ${cmd} in
[Ss][Tt][Aa][Rr][Tt]) pcgi_start;;
[Ss][Tt][Oo][Pp]) pcgi_stop;;
[Rr][Ee][Ss][Tt][Aa][Rr][Tt]) pcgi_restart;;
[Ss][Tt][Aa][Tt][Uu][Ss]) pcgi_status 0;;
*)      pcgi_help ;;
esac

0
0
4
2
Abid Riaz 110 points

                                    A shell script is a computer program designed to be run by the Unix/Linux shell which could be one of the following:

The Bourne Shell
The C Shell
The Korn Shell
The GNU Bourne-Again Shell
A shell is a command-line interpreter and typical operations performed by shell scripts include file manipulation, program execution, and printing text.

for more visit https://www.tutorialspoint.com/unix/shell_scripting.htm

4 (2 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source