I am writing a script to copy files that contains a while loop to compare files that will do a cp -p until the filesizes are equal. I am getting a strange error though when the script gets to executing the while loop.
here is my code:
the error i get is missing ]
i have tried several different whiles, like this [while foo do something] and [[while foo do something ]] and quotes, no quotes around the variables as well as tick marks...
so here are my questions: 1. if i just used a file to compare against, is it possible that the while operation is messing up there? 2. i used the solaris scripting book and it said two brackets and quotes.
whatever assistance you can provide would be greatly appreciated.
Thanks, i found another error so i will re write it in the korn shell. I was also wanting to change it so that i am putting the cp -p in the background and performing some math operations to let the user know that their copy is still in progress.
and yes, it was not a direct copy and paste, so the errors that you all found were definitely errors.
I was trying to implement a nested for do loop to run a perl script.
for i in 1 10 50
do
for j in 2 12 55
do
perl script.pl "$i" "$i" "$j"
done
done
when I implemented it within a shell script, i got the output, but every time j value will 55, or basically the last value of j in... (10 Replies)
I have a file Table.out having table name like this
Table_Emp
Table_Exp
Table_Fcr
To show first 10 rows .. I' wrtng a script like this ..
#!/bin/ksh
cat /tmp/table.out|while read -r table vbar1
do
<connect to db>
then
select * from $table limit 10; > /tmp/1.out
done
... (3 Replies)
the program just prints all the command line arguments
Getting error in the program
error
./hellow: line 13: 0: command not found
./hellow: line 13: 0: command not found
below is the program
#!/bin/bash
num=$#
echo $num
if
then
echo "No arguments are passed ."
else
... (7 Replies)
Hello All,
I am having a problem with an “if loop” within a “while loop” in my Korn Shell program. The basic concept of the program is that it searches for the existence of a series of load files in a load directory, and once it finds one of these files, it begins the following process:
· Creates... (4 Replies)
Hi,
I get the following output
98 -1
98 0
./get_AB04-time: line 79: ((: i< && 0 !=7 : syntax error: operand expected (error token is "&& 0 !=7 ")
I have this part of code. Line 79 is the line of the for loop.
echo ${OCCURRENCE} $i_START
CASE=0;
i_END=${i_START}... (4 Replies)
Hi,
Iam trying to add a while loop in my script in the below way which gets value from count file and checks if its not equal to 0.If yes then it shld echo me a message.
while //count file has some number other than 0
do
echo "count is not zero"
done
But iam getting this error:... (5 Replies)
send byte=10 ,
I test two target, A and B different os.
The TCP_STREAM' s result is higher than B
but TCP_RR result is lower than B
why? please help me (0 Replies)
while read line
do
echo "read line is $line"
done < $file
where $file is file having following contents
1=one
2=two
3=three
but above while loop is not able to print last line !!
why ? (3 Replies)
I have 2 Dell Poweredge 1950 servers running . I have been having intermittent performance issues with the NIC cards on one of them. The two servers are identical and are running the same operating system. The server that has the issue is on the DMZ on a a static IP and is hosting a website. ... (0 Replies)