11-16-2011
help in running while loop inside a shell script
I have an input file at ./$1.txt
with content of seq numbers like :
1234567890
1234589700
.
.
so on..
I need to take each seq nbr from the input file ,run the query below:
select ackname,seqnbr from event where event_text like '%
seqnbr( from the input file)'
and redirect the query output to a file :log.txt
this has to be done for all seq nbr's in the input file.
Can anyone please help me out in this:-(
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i am substituting some text in the xml file using sed, on shell directly it works fine, but when i run it inside script file, it say, the function cant be parsed, i think the prob is due to xml file, kindly help (4 Replies)
Discussion started by: bajaj111
4 Replies
2. Shell Programming and Scripting
I have a command nested in some while loops to parse some data that looks something like this.
while ($condition)
while ($condition)
...
gzcat /dir/$fileName.gz | grep $searchString > out_file
end
end
On the first loop, the command is executed properly (and takes maybe 10... (3 Replies)
Discussion started by: hobbers
3 Replies
3. Shell Programming and Scripting
Hi all,
I am having a script ScriptA which is calling a script ScriptB in the same server and copying files to second server and have to execute one script ScriptC in the second server. THis First script ScriptA is the main script and i have to execute this process continously.
for Keeping... (2 Replies)
Discussion started by: rohithji
2 Replies
4. Windows & DOS: Issues & Discussions
below is the output where i'm getting the same times tamp throughout the loop., where i'm expecting that to log the current time stamp..
C:\Users\ilango>for /l %i in (1,1,5) do echo for %i
C:\Users\ilango>echo for 1
for 1
C:\Users\ilango>echo for 2
for 2
C:\Users\ilango>echo... (1 Reply)
Discussion started by: ilan
1 Replies
5. Shell Programming and Scripting
Hi all
I run my program prog.c in the following way :
$ ./prog 1 > output.txt where 1 is a user defined initial value used by the program.
But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files.
Like
$ ./prog 1... (1 Reply)
Discussion started by: alice06
1 Replies
6. Shell Programming and Scripting
Need to increment the date from "currentdate + 90days" inside the for loop (i=1 to i=50) (5 Replies)
Discussion started by: aroragaurav.84
5 Replies
7. Shell Programming and Scripting
Hello,
You might help a newbie like me, I am trying to run a .sh inside my shell script. After running that I need to execute below commands. Here's how my scripts looks like. Hope you can help:
#!/bin/sh
cd $ORACLE_HOME/owb/bin/unix
./OMBPlus.sh ---> goes to OMB+> directory
cd... (10 Replies)
Discussion started by: aderamos12
10 Replies
8. Shell Programming and Scripting
Hi ,
Please excuse me for opening a new thread i am unable to find out the syntax error
in my if else condition inside for loop in awk command ,
my actual aim is to print formatted html td tag when if condition (True) having string as "failed",
could anyone please advise what is the right... (2 Replies)
Discussion started by: karthikram
2 Replies
9. Shell Programming and Scripting
Hi All, my script.sh has the below lines, and i need to run the script as root or wam. please tell me if this will work
#!/bin/bash
sudo -t wam /usr/local/wam/stopwam -r ------- this needs run as wam user
/usr/local/web/stopweb -a --- this needs to run as... (18 Replies)
Discussion started by: nanz143
18 Replies
10. UNIX for Beginners Questions & Answers
I have if loop with multiple variable value check in if loop. How can i print only if loop satisfied variable and its value in shell script ? I dont want to check each variable in if loop. That makes my script larger.
if ]
then
echo "Only satisfied variable with value"
... (3 Replies)
Discussion started by: prince1987
3 Replies
SEQ(1) BSD General Commands Manual SEQ(1)
NAME
seq -- print sequences of numbers
SYNOPSIS
seq [-w] [-f format] [-s string] [-t string] [first [incr]] last
DESCRIPTION
The seq utility prints a sequence of numbers, one per line (default), from first (default 1), to near last as possible, in increments of incr
(default 1). When first is larger than last the default incr is -1.
All numbers are interpreted as floating point.
Normally integer values are printed as decimal integers.
The seq utility accepts the following options:
-f format Use a printf(3) style format to print each number. Only the E, e, f, G, g, and % conversion characters are valid, along with
any optional flags and an optional numeric minimum field width or precision. The format can contain character escape sequences
in backslash notation as defined in ANSI X3.159-1989 (``ANSI C89''). The default is %g.
-s string Use string to separate numbers. The string can contain character escape sequences in backslash notation as defined in ANSI
X3.159-1989 (``ANSI C89''). The default is
.
-t string Use string to terminate sequence of numbers. The string can contain character escape sequences in backslash notation as
defined in ANSI X3.159-1989 (``ANSI C89''). This option is useful when the default separator does not contain a
.
-w Equalize the widths of all numbers by padding with zeros as necessary. This option has no effect with the -f option. If any
sequence numbers will be printed in exponential notation, the default conversion is changed to %e.
The seq utility exits 0 on success and non-zero if an error occurs.
EXAMPLES
# seq 1 3
1
2
3
# seq 3 1
3
2
1
# seq -w 0 .05 .1
0.00
0.05
0.10
SEE ALSO
jot(1), printf(1), printf(3)
HISTORY
The seq command first appeared in Plan 9 from Bell Labs. A seq command appeared in NetBSD 3.0, and ported to FreeBSD 9.0. This command was
based on the command of the same name in Plan 9 from Bell Labs and the GNU core utilities. The GNU seq command first appeared in the 1.13
shell utilities release.
BUGS
The -w option does not handle the transition from pure floating point to exponent representation very well. The seq command is not bug for
bug compatible with the Plan 9 from Bell Labs or GNU versions of seq.
BSD
February 19, 2010 BSD