I've just tried a few things...
the #!/usr... line is being ignored, probably because init is invoking your script. Probably the same reason why $SHELL is not set.
Change your S?? startup script to run the korn shell script.
run this via root cron:-
#!/usr/bin/ksh
UserName=$1
who |grep "^${UserName} " > /dev/null 2>&1 &&
{
while :
do
sleep 60
who |grep "^${UserName} " > /dev/null 2>&1 ||
{
passwd -l...
oops didn't notice the #!/usr/bin/ksh line
ksh should run this script ok
A potential source of the "set" error could be the contents of pfile.
These scripts are run by root.
root's shell is usually /sbin/sh (Bourne)
You can run a Korn shell script during startup if you put the #!/bin/ksh line at the start of the script.
Make sure that /usr is mounted before you run a Korn shell script. /bin is a symlink to /usr/bin.
this function checks if $1 is an integer
Not sure if it works in bash
isnum()
{
case ${1} in
+([0-9])) return 0 ;;
*) return 1 ;;
esac
}
or in your case where you're testing for an integer > 0
let $x 2> /dev/null
and check the return code
Salem's right about [ ed ...
#!/bin/ksh
while read -- line
do
set -- $line # this loads $1 $2 .. with each field in $line
do some stuff
done < MyFile
You can also get the individual fields like this
while read -- f1 f2 f3
All this assumes that the field separater in the file is white space. If not, you'll...
the grep, awk and | are behaving as expected.
It's the output from the grep that is causing the problem.
grep will return the count of occurences in pattern, or the pattern, or the filename depending on the option. BUT it will only return 1 token.
Try this:-
[[ $(grep -c "yo"...
I get no errors from this code fragment. I suspect you wouldn't either.
The cause of your error is in some other part of the script (k4[82]: syntax error at line 143 :).
Please post the entire script.
set -x
param=$1
case ${param} in
stop)
set -A instance2 `ps -ef | grep [o]ra_smon |...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.