hi friends,
i wrote one simple shell script.. in that am using for loop... when i am trying to execute the script[ksh-x filename].it shows syntax error at for loop line '((' unexpected.
Last edited by otheus; 02-17-2009 at 02:54 PM..
Reason: code tags, formatting
Hi,
Working on AIX using the following for loop.
for a in `find /edi/iTracTEST/sessions -name nohup.out -print`
do
echo $a
done
On the command line it works fine, but insert the code in a file and then running it, it does not want to work. I get the following back.
' is not... (3 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)
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)
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)
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)
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)
Hi All,
while executing this code ,I'm gettign below Error
if_test: line 3:
#!/bin/bash
if ;
then
echo "this is aginity;"
elif ;
then
echo "this is informatica;"
fi
exit (3 Replies)
This is my first ever bash script. What i wish to achieve is to find all files in current directory except the script file and count lines in each found file. Some thing seems to be wrong with the if statement :confused: Please help why it does not work? and maybe you have some ideas how to improve... (3 Replies)
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)
There are two files abc_123.dat and abc_345.dat if at least one file exists then enter into the loop and remove file and exit.
In first iteration, deleting files successfully
but "else" statement executing after deleting files."else" should execute only if there is no file in the directory.... (1 Reply)
Discussion started by: Rajesh123
1 Replies
LEARN ABOUT OPENSOLARIS
echo
echo(1B) SunOS/BSD Compatibility Package Commands echo(1B)NAME
echo - echo arguments to standard output
SYNOPSIS
/usr/ucb/echo [-n] [argument]
DESCRIPTION
echo writes its arguments, separated by BLANKs and terminated by a NEWLINE, to the standard output.
echo is useful for producing diagnostics in command files and for sending known data into a pipe, and for displaying the contents of envi-
ronment variables.
For example, you can use echo to determine how many subdirectories below the root directory (/) is your current directory, as follows:
o echo your current-working-directory's full pathname
o pipe the output through tr to translate the path's embedded slash-characters into space-characters
o pipe that output through wc -w for a count of the names in your path.
example% /usr/bin/echo "echo $PWD | tr '/' ' ' | wc -w"
See tr(1) and wc(1) for their functionality.
The shells csh(1), ksh(1), and sh(1), each have an echo built-in command, which, by default, will have precedence, and will be invoked if
the user calls echo without a full pathname. /usr/ucb/echo and csh's echo() have an -n option, but do not understand back-slashed escape
characters. sh's echo(), ksh's echo(), and /usr/bin/echo, on the other hand, understand the black-slashed escape characters, and ksh's
echo() also understands a as the audible bell character; however, these commands do not have an -n option.
OPTIONS -n Do not add the NEWLINE to the output.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), echo(1), ksh(1), sh(1), tr(1), wc(1), attributes(5)NOTES
The -n option is a transition aid for BSD applications, and may not be supported in future releases.
SunOS 5.11 3 Aug 1994 echo(1B)