#! /bin/shecho "Current command is $0"echo "The first parameter is $1"echo "The second parameter is $2"echo "The third parameter is $3"echo "Total of parameters if $#"echo "Current PID is $$"#!/bin/bashtimes=0until [ "$times" = 3 ];doecho "I love linux."sleep 2times=`expr $times + 1`done#!/bin/bash# menu shell script. samli 2004.4.19 untilecho "List Directory..........1"echo "Change Directory........2"echo "Edit File...............3"echo "Remove File.............4"echo "Exit Menu...............5"read choicetest $choice = 5docase $choice in1) ls;;2) echo "enter target directory:" read dircd $dir;;3) echo "enter file name:"read filevi $file;;4) echo "enter file name:"read filerm $file;;5) echo "Goodbye";;*) echo "illegal option, please input again." esacdone#! /bin/shvar1="abcd efg"echo $var1var2=1234echo "The value of var2 is $var2"echo $HOMEecho $PATHecho $PWD#! /bin/shnum=0while [ $num -le 10 ]donum=`expr $num + 1`if [ $num -eq 5 ]thencontinuefisquare=`expr $num \* $num`echo $squaredone#!/bin/bash# Gnu bash versions 2.x# The Party Program--Invitations to friends from the# "guest" fileguestfile=./guests # ~/shell/guestsif [[ ! -e "$guestfile" ]]thenprintf "${guestfile##*/} non-existent"exit 1fiexport PLACE="Sarotini's"(( Time=$(date +%H) + 1 ))set cheese crackers shrimp drinks "hot dogs" sandwichesfor person in $(cat $guestfile)doif [[ $person = root ]]thencontinueelse# Start of here documentmail -v -s "Party" $personHi ${person}! Please join me at $PLACE for a party!Meet me at $Time o'clock.I'll bring the ice cream. Would you please bring $1and anything else you would like to eat? Let me knowif you can't make it.Hope to see you soon.Your pal,ellie@$(hostname)FINISshiftif (( $# == 0 ))thenset cheese crackers shrimp drinks "hot dogs" sandwiches fifidoneprintf "Bye..."#!/bin/sh# Standard AT&T Bourne Shell# The Party Program--Invitations to friends from the# "guest" fileguestfile=./guests # /home/ellie/shell/guestsif [ ! -f "$guestfile" ]thenecho "慴asename $guestfile?non-existent"exit 1fiPLACE="Sarotini's"export PLACETime=`date +%H`Time=`expr $Time + 1`set cheese crackers shrimp drinks "hot dogs" sandwichesfor person in $(cat $guestfile)doif [ $person = root ]]thencontinueelse# Start of here documentmail -v -s "Party" $personHi $person! Please join me at $PLACE for a party!Meet me at $Time o'clock.I'll bring the ice cream. Would you please bring $1and anything else you would like to eat? Let me knowif you can't make it.Hope to see you soon.Your pal,ellie@`hostname`FINISshiftif [ $# -eq 0 ]thenset cheese crackers shrimp drinks "hot dogs" sandwiches fifidoneecho "Bye..."#!/bin/sh# Scriptname: args# Script to test command line argumentsecho The name of this script is $0.echo The arguments are $*.echo The first argument is $1.echo The second argument is $2.echo The number of arguments is $#.oldargs=$*set Jake Nicky Scott # reset the positional parameters echo All the positional parameters are $*.echo The number of postional parameters is $#.echo "Good~Vbye for now, $1 "set $(date) # reset the positional parametersecho The date is $2 $3, $6.echo "The value of \$oldargs is $oldargs."set $oldargsecho $1 $2 $3# Name: bigfiles# Purpose: Use the find command to find any files in the root# partition that have not been modified within the past n (any# number within 30 days) days and are larger than 20 blocks# (512 byte blocks)if (( $# != 2 )) # or [ $# -ne 2 ]thenecho "Usage: $0 mdays size " 1>&2exit 1fiif (( $1 0 || $1 > 30 )) # or [ $1 -lt 0 -o $1 -gt 30 ] thenecho "mdays is out of range"exit 2fiif (( $2 # or [ $2 -le 20 ]thenecho "size is out of range"exit 3fifind / -xdev -mtime $1 -size +$2#!/bin/bash# Scriptname: checker# Script to demonstrate the use of special variable# modifiers and argumentsname=${1:?"requires an argument" }echo Hello $name#!/bin/bash# This is the first Bash shell program of the day.# Scriptname: greetings# Written by: Barbara Bashfulecho "Hello $LOGNAME, it's nice talking to you."echo "Your present working directory is `pwd`."echo "You are working on a machine called `uname -n`." echo "Here is a list of your files."ls # list files in the present working directoryecho "Bye for now $LOGNAME. The time is `date +%T`!"#!/bin/bash# Scriptname: greetings2echo "This script is called $0."echo "$0 $1 and $2"echo "The number of positional parameters is $#"#!/bin/bash# Scriptname: idcheck# purpose:check user id to see if user is root.# Only root has a uid of 0.# Format for id output:uid=9496(ellie) gid=40 groups=40# root's uid=0id=`id | gawk -F'[=(]' '{print $2}'` # get user id echo your user id is: $idif (( id == 0 )) # or [ $id -eq 0 ]thenecho "you are superuser."elseecho "you are not superuser."fi。