It is certainly possible to do this with awk, but it is much easier in shell.
Try:
This will work with up to 999 files named using this scheme. There are other ways to do this using for i in {1-968} and similar extensions, but these aren't available on all systems and are not defined by the standards. The script above should work with any POSIX conforming shell (I use ksh).
I save the script as eon-run.sh and tried to run the script as " sh eon-run.sh"
It shows error as "eon command not found in line 5.
However, the command line works if i run the one by one.
Kindly advice.
Many Thanks
Balaji
Quote:
Originally Posted by Don Cragun
It is certainly possible to do this with awk, but it is much easier in shell.
Try:
This will work with up to 999 files named using this scheme. There are other ways to do this using for i in {1-968} and similar extensions, but these aren't available on all systems and are not defined by the standards. The script above should work with any POSIX conforming shell (I use ksh).
Please enter the following command in your shell:
and add the same two lines as the 2nd and 3rd lines of eon-run.sh.
Then rerun eon-run.sh and compare the output of those two commands.
Note that unless you only intend to run this script once, rather than using the command:
to run this script, it is usually easier to do the following:
and then just execute it using the command:
but, of course, this assumes that $HOME/bin is an existing directory and that $HOME/bin is in $PATH.
Note that if ksh isn't located in /bin on your system, you'll need to edit the 1st line of eon-run.sh to specify an absolute pathname of ksh on your system.
I checked for path of ksh, as you mentioned its in the path /bin/ksh.
If /home/Balaji is my curremt working directory, where should I have to add the lines
Please advice.
Many Thanks
Balaji
Quote:
Originally Posted by Don Cragun
Please enter the following command in your shell:
and add the same two lines as the 2nd and 3rd lines of eon-run.sh.
Then rerun eon-run.sh and compare the output of those two commands.
Note that unless you only intend to run this script once, rather than using the command:
to run this script, it is usually easier to do the following:
and then just execute it using the command:
but, of course, this assumes that $HOME/bin is an existing directory and that $HOME/bin is in $PATH.
Note that if ksh isn't located in /bin on your system, you'll need to edit the 1st line of eon-run.sh to specify an absolute pathname of ksh on your system.
I repeat: Type those two commands into your shell. And, add them as new lines in eon-run.sh after the line #!/bin/ksh and rerun eon-run.sh.
Compare the results of running those commands in your shell and running those commands in eon-run.sh. (Or just post the output from your shell when you run those commands and post the output from eon-run.sh when you rerun it.)
and I tried running the command eon_run.sh, it shows error as
Kindly advice.
Many Thanks
Balaji
Quote:
Originally Posted by Don Cragun
I repeat: Type those two commands into your shell. And, add them as new lines in eon-run.sh after the line #!/bin/ksh and rerun eon-run.sh.
Compare the results of running those commands in your shell and running those commands in eon-run.sh. (Or just post the output from your shell when you run those commands and post the output from eon-run.sh when you rerun it.)
I create a CGI in bash/html.
My awk script looks like :
echo "<table>"
for fn in /var/www/cgi-bin/LPAR_MAP/*;
do
echo "<td>"
echo "<PRE>"
awk -F',|;' -v test="$test" '
NR==1 {
split(FILENAME ,a,"");
}
$0 ~ test {
if(!header++){
... (12 Replies)
The company I am with is using Oracle Supply Chain Planing 8.12.1 with JDE 8.12. This is a Unix based system running on Windows Servers using Hummingbird Exceed Version 14 for interactive processing
We are currently attempting to automate the Advance Planning Agent flows on a couple of... (2 Replies)
Hi All,
I am currently looking at automating the steps that I follow to download log files from putty to desktop.
I connect to a client's machine through citrix desktop. I am required to download quite a number of application logs to identfiy the issues in production.
Steps that is being... (3 Replies)
Hi,
I have a file with date in it like:
UserString1
UserString2
UserString3
UserString4
UserString5
I need two entries for each line so it reads like
UserString1
UserString1
UserString2
UserString2
etc. Can someone help me with the awk command please?
Thanks (4 Replies)
Hello all,
Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val:
> cat getnon0file.sh
#!/bin/bash
this="getnon0file.sh"
USAGE=$this"
InFile="xyz.38"
Min="0.05"
#
awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Hi,
I have to add the 'newgrp' command to my login (.cshrc) script.
The problem is that if I add it, it comes to infinite look, since newgrp opens new shell again and again.
How to automate the newgrp when I have to login, and avoid that loop?
Currently I'm thinking of a condition that... (2 Replies)
Sorry for the duplicate thread this one is similar to the one in
https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121
Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Hi all
I am trying to create a script to automate the creating of filesystems.
The problem I am having is as follows:-
After creating the Log Logical Volume, I want to format it, using the logform command.
The Logform command expects user intervention, by typing 'y' and 'enter' to continue.... (2 Replies)
Hi,
Can u see the code below.
set xyz = `cat testt1.txt | awk '/-----/{\
print $1 }\
' | tail -1`
I need to execute it in c shell . What is wrong with the above command.
When i write everything on a single line then it is working.
Can anybody help me . (0 Replies)