This looks like a blend of bits of unix shell script and Oracle sqlplus commands.
Shell commands do not need a semi-colon at the end of the command unless there is another shell command on the same line.
Commands for sqlplus do need a semi-colon but need to be presented to sqlplus not shell.
There is actually a shell syntax error on most of the lines. The level of problem depends on whether some of the commands should be processed by Oracle sqlplus or not.
What is the script meant to do?
Is there a database involved, or are you trying to run Oracle sqlplus syntax commands in shell?
What is in file "b.dat" ?
Last edited by methyl; 07-17-2009 at 01:55 PM..
Reason: Typos
Guys,, sorry wasn well so unable to reply to all...
@methyl
yes, actually this is blend of unix and db2,,, actually i have fixed the error.. But now the expr command is actually causing a problem..
@sriharsha_kvr
thanks for ur suggestion.. But i need to include a bracket to make sure the order of execution of the operations.. Can you please guide me how to do it?
expr need arguments = argument delimeter between arguments.
It's always commandline = shell parse file generation, ... (in this case *), and ( ) is subshell. So we have to tell for shell = don't parse ( ) *
You can do integer calculation using shell, no need to ex. expr. Only old bsh can't do it.
ksh99, bash, ... can do it, ksh also using floating. Bash, expr, ... only integers.
Shell (all posix compatible sh):
bc is also real calculator, also floating support, in this case:
Hi all,
a problem with a loop. Imagine it starts with
var1="$(cat txtif.out )"while
do
echo file1
echo file2
echo y > txtif.out
if
then
break
fi
done
exit 0
the problem is that if the file is changing during the loop seems to continue as it reads "x" state,... (5 Replies)
I am trying to do a while do loop that asks for a password and returns if the password entered is incorrect. I have that part working however i want to modify it so that if a similar word is entered it will read "that is close but incorrect" and i cannot seem to get it working, being new in the... (6 Replies)
Hi,
I work on Ab-initio ETL tool which is based on Unix. I made a small script which has two loop's one with in another. All the functionality is working for the first line of outer loop but when it comes to other lines of outer loop it is throwing error as command not found. Below is the... (4 Replies)
Hi Script Gurus,
I am facing issue with while loop in bash. The while loop is running as end less loop even after given criteria does not meet.
STATE_BEFORE_SPLIT () {
for clone in $Clonegroups; do
state=$( $Navicmd -listclone -name $clone -cloneid $Cloneid |awk... (3 Replies)
I have a while loop with -f and -o option.Can any one please tell me what that stands for?The Sample code is as follows:-
while
do
## some processing
done (10 Replies)
hi
I had created a while loop in a script file called whiletest.sh as follows
as follows:
count=0
max=10
while
do
echo $count
echo count=$(count+1)" "
done
echo "value of count:$count"
then i run the script with the command
sh whilestest.sh
but its giving me an error... (5 Replies)
Hi
What is wrong with this loop
it was taken has a example in book!!!
it returns
then
/usr/sbin/svcadm disable ppserv
else /usr/sbin/ppadmin stop
fi
} (3 Replies)
Hi guys my while do loop is not working properly;
As soon as the load_date and run_date is same it should stop can somebody tell me where I am having the problem?
In an oracle table I have
LOAD_DT=5/1/2009 DATE datatype
RUN_DT=5/5/2009 DATE datatype
Now in a script with a spool file I get the... (15 Replies)
Hi,
I have a directory called logs in which i have the log files.
i have to touch the file before deleting it.
i am doing like this
filestodelete="*.log* *log*"
for files in $filestodelete
do
touch $files $files.$(date +%a)
rm -f $filestodelete
done
touch is not working... (5 Replies)
hi all,
i have written the following code:
while(proceed !='Y' && proceed!='N' && proceed!='y' && proceed!='n')
{
printf("\nPress \n\t 'Y' or 'y' to continue \n\t 'N' or 'n' to cancel:");
scanf("%c",&proceed);
}
the output i am gettin is:
Press
'Y' to continue
... (1 Reply)