awk script for automating the other commercial software command lines


 
Thread Tools Search this Thread
Top Forums Programming awk script for automating the other commercial software command lines
# 8  
Old 12-01-2012
Change line 2 of eon-run.sh from:
Code:
echo $/home/Balaji/electrostatics

to:
Code:
echo $PATH

Then type the following commands into your shell and post the results:
Code:
echo $PATH
type eon
ksh eon-run.sh

# 9  
Old 12-01-2012
Hi Don

I changed to

Code:
#!/bin/ksh
echo $PATH
type eon
ksh eon_run.sh

for file in shape_eon_input_[1-9].oeb.gz shape_eon_input_[1-9][[0-9].oeb.gz shape_eon_input_[1-9][0-9][0-9].oeb.gz
do      seq=${file##*_}
        seq=${seq%%.*}
        eon -dbase $file -besthits 47500 -prefix Eon-seq
done

It shows error as

Code:
bash: eon_run.sh: command not found

Kindly advice.

Many Thanks
Balaji

Quote:
Originally Posted by Don Cragun
Change line 2 of eon-run.sh from:
Code:
echo $/home/Balaji/electrostatics

to:
Code:
echo $PATH

Then type the following commands into your shell and post the results:
Code:
echo $PATH
type eon
ksh eon-run.sh

# 10  
Old 12-01-2012
Please reread the directions I gave you in message #8 in this thread. You didn't even come close to doing what I suggested. Given where you are now, please follow these steps EXACTLY:
  1. Type the command:
    Code:
    echo $PATH

    into your shell and report the results.
  2. Type the command:
    Code:
    type eon

    into your shell and report the results.
  3. Remove the line: ksh eon_run.sh from eon-run.sh.
  4. Type the command:
    Code:
    ksh eon-run.sh

    into your shell and report the results.
  5. Type the command:
    Code:
    pwd

    into your shell and report the results.
  6. Type the command:
    Code:
    ls -l eon-run.sh

    into your shell and report the results.
  7. Type the command:
    Code:
    ls -ld $HOME/bin $HOME/bin/eon-run.sh

    into your shell and report the results.
# 11  
Old 12-01-2012
Hi Don

Kindly find the following

Code:
echo $path

result
Code:
/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/Balaji/Desktop/grace-5.1.12/src:/home/Balaji/acceleratedMD_analysis/aMD_CBP/aMD_30ptn_lipid/seed4545/ss_plot.c:/home/Balaji/Desktop/smap_v2_0:/home/Balaji/polypharmacology_simulations/test_03:/home/Balaji/Desktop/weblogo:/home/Balaji/Desktop/openeye_progrms/openeye/bin/vida:/home/Balaji/Desktop/openeye_progrms/openeye/bin/vrocs:/home/Balaji/Desktop/openeye_progrms/openeye/bin/rocs:/home/Balaji/Desktop/openeye_progrms/openeye/bin/szybki:/home/Balaji/Desktop/openeye_progrms/openeye/bin/szmap:/home/Balaji/Desktop/openeye_progrms/openeye/bin/posit:/home/Balaji/Desktop/openeye_progrms/openeye/bin/eon:/home/Balaji/Desktop/openeye_progrms/openeye/bin/vbrood:/home/Balaji/Desktop/openeye_progrms/openeye/bin/omega2:/home/Balaji/Desktop/openeye_progrms/openeye/bin/fred:/home/Balaji/vmd-1.9.1/bin/vmd:/home/Balaji/moe2011/bin/moe:/home/Balaji/bin:/home/Balaji/moe2011/bin:/home/Balaji/Desktop/grace-5.1.12/src:/home/Balaji/acceleratedMD_analysis/aMD_CBP/aMD_30ptn_lipid/seed4545/ss_plot.c:/home/Balaji/Desktop/smap_v2_0:/home/Balaji/polypharmacology_simulations/test_03:/home/Balaji/Desktop/weblogo:/home/Balaji/Desktop/openeye_progrms/openeye/bin/vida:/home/Balaji/Desktop/openeye_progrms/openeye/bin/vrocs:/home/Balaji/Desktop/openeye_progrms/openeye/bin/rocs:/home/Balaji/Desktop/openeye_progrms/openeye/bin/szybki:/home/Balaji/Desktop/openeye_progrms/openeye/bin/szmap:/home/Balaji/Desktop/openeye_progrms/openeye/bin/posit:/home/Balaji/Desktop/openeye_progrms/openeye/bin/eon:/home/Balaji/Desktop/openeye_progrms/openeye/bin/vbrood:/home/Balaji/Desktop/openeye_progrms/openeye/bin/omega2:/home/Balaji/Desktop/openeye_progrms/openeye/bin/fred:/home/Balaji/vmd-1.9.1/bin/vmd:/home/Balaji/moe2011/bin/moe

2. type eon
Code:
eon is aliased to $eon

3. ls -l eon_run.sh
Code:
-rw-rw-r-- 1 Balaji Balaji 270 Dec 1 18:27

4. ls -ld $HOME/bin $HOME/bin/eon_run.sh

Code:
ls: /home/Balaji/bin: No such file or directory
ls:  /home/Balaji/bin/eon_run.sh: No such file or directory

Kindly advice.

Many Thanks
Balaji
# 12  
Old 12-01-2012
Quote:
Originally Posted by bala06
Hi Don

Kindly find the following

Code:
echo $path

result
Code:
/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin: ... ... ...

2. type eon
Code:
eon is aliased to $eon

3. ls -l eon_run.sh
Code:
-rw-rw-r-- 1 Balaji Balaji 270 Dec 1 18:27

4. ls -ld $HOME/bin $HOME/bin/eon_run.sh

Code:
ls: /home/Balaji/bin: No such file or directory
ls:  /home/Balaji/bin/eon_run.sh: No such file or directory

Kindly advice.

Many Thanks
Balaji
In the 3rd message in this thread you said:
Quote:
I save the script as eon-run.sh and tried to run the script as " sh eon-run.sh"
I now see that instead of saving the script in eon-run.sh and running sh eon-run.sh you saved the script as eon_run.sh and ran the script using sh eon-run.sh. That explains a few things. You did some of the things I asked you to do last time and skipped others.

So, to resolve you problem, please insert the following line into eon_run.sh after line 1:
Code:
echo eon is $eon

and then PLEASE TYPE THE FOLLOWING COMMANDS INTO YOUR SHELL EXACTLY and report the results:
  1. Code:
    echo $eon

  2. Code:
    ksh eon_run.sh

# 13  
Old 12-01-2012
Hi Don

Sorry for above confusion

1.echo $eon

Code:
/home/Balaji/Desktop.openeye_programs/openeye/bin/eon

2. ksh eon_run.sh

Code:
/home/Balaji/Desktop.openeye_programs/openeye/bin/eon
eon: not found

Kindly advice.

Many Thanks
Balaji
# 14  
Old 12-01-2012
OK Looking at everything you've supplied so far, it seems that most of your problem are related to your shell execution environment (especailly your setting for $PATH).

The : separated values in $PATH are supposed to be directories of commands that you execute frequently; not the names of the executable files that you want to execute. And, having a directory in $PATH more than once only slows down command executiion by your shell. When I replaced the colons in your $PATH value with newlines and sorted the results, I got:
Code:
 /bin
/home/Balaji/Desktop/grace-5.1.12/src
/home/Balaji/Desktop/grace-5.1.12/src
/home/Balaji/Desktop/openeye_progrms/openeye/bin/eon
/home/Balaji/Desktop/openeye_progrms/openeye/bin/eon
/home/Balaji/Desktop/openeye_progrms/openeye/bin/fred
/home/Balaji/Desktop/openeye_progrms/openeye/bin/fred
/home/Balaji/Desktop/openeye_progrms/openeye/bin/omega2
/home/Balaji/Desktop/openeye_progrms/openeye/bin/omega2
/home/Balaji/Desktop/openeye_progrms/openeye/bin/posit
/home/Balaji/Desktop/openeye_progrms/openeye/bin/posit
/home/Balaji/Desktop/openeye_progrms/openeye/bin/rocs
/home/Balaji/Desktop/openeye_progrms/openeye/bin/rocs
/home/Balaji/Desktop/openeye_progrms/openeye/bin/szmap
/home/Balaji/Desktop/openeye_progrms/openeye/bin/szmap
/home/Balaji/Desktop/openeye_progrms/openeye/bin/szybki
/home/Balaji/Desktop/openeye_progrms/openeye/bin/szybki
/home/Balaji/Desktop/openeye_progrms/openeye/bin/vbrood
/home/Balaji/Desktop/openeye_progrms/openeye/bin/vbrood
/home/Balaji/Desktop/openeye_progrms/openeye/bin/vida
/home/Balaji/Desktop/openeye_progrms/openeye/bin/vida
/home/Balaji/Desktop/openeye_progrms/openeye/bin/vrocs
/home/Balaji/Desktop/openeye_progrms/openeye/bin/vrocs
/home/Balaji/Desktop/smap_v2_0
/home/Balaji/Desktop/smap_v2_0
/home/Balaji/Desktop/weblogo
/home/Balaji/Desktop/weblogo
/home/Balaji/acceleratedMD_analysis/aMD_CBP/aMD_30ptn_lipid/seed4545/ss_plot.c
/home/Balaji/acceleratedMD_analysis/aMD_CBP/aMD_30ptn_lipid/seed4545/ss_plot.c
/home/Balaji/bin
/home/Balaji/moe2011/bin
/home/Balaji/moe2011/bin/moe
/home/Balaji/moe2011/bin/moe
/home/Balaji/polypharmacology_simulations/test_03
/home/Balaji/polypharmacology_simulations/test_03
/home/Balaji/vmd-1.9.1/bin/vmd
/home/Balaji/vmd-1.9.1/bin/vmd
/usr/X11R6/bin
/usr/bin
/usr/kerberos/bin
/usr/local/bin

Since you have an alias for eon that is a shell variable that expands to /home/Balaji/Desktop/openeye_progrms/openeye/bin/eon, it seems obvious that /home/Balaji/Desktop/openeye_progrms/openeye/bin is a directory containing the executables for eon, fred, omega2, posit, rocs, szybki, vbrood, vida, and vrocs. It is also highly likely that /home/Balaji/vmd-1.9.1/bin is a directory containing the executable vmd, and /home/Balaji/vmd-1.9.1/bin is a directory containing the executable moe. I'm pretty sure that /home/Balaji/acceleratedMD_analysis/aMD_CBP/aMD_30ptn_lipid/seed4545/ss_plot.c is not a directory and that ss_plot.c is not an executable file, and that /home/Balaji/polypharmacology_simulations/test_03 and /home/Balaji/Desktop/smap_v2_0 don't need to be in $PATH.

If you change the place where you initialize $PATH to set it to:
Code:
/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/Balaji/Desktop/grace-5.1.12/src:/home/Balaji/Desktop/smap_v2_0:/home/Balaji/Desktop/weblogo:/home/Balaji/Desktop/openeye_progrms/openeye/bin:/home/Balaji/vmd-1.9.1/bin/vmd:/home/Balaji/bin:/home/Balaji/moe2011/bin

and then log out, log in again, and run the original script I gave you in message #2 in this thread by issuing the command:
Code:
ksh eon_run.sh

everything should work.

I don't know how many aliases you have like eon, but with this suggested change to $PATH you can certainly get rid of the alias for eon. If you have similar aliases for the other executables in /home/Balaji/Desktop/openeye_progrms/openeye/bin, you can get rid of all of them too.

Last edited by Don Cragun; 12-01-2012 at 08:13 PM.. Reason: fixed typo in last paragraph.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to put the command to remove duplicate lines in my awk script?

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)
Discussion started by: Tim2424
12 Replies

2. Windows & DOS: Issues & Discussions

Automating an UNIX Based Software Package on Windows

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)
Discussion started by: pfaloney
2 Replies

3. Shell Programming and Scripting

awk command to find seq lines

I have a below file FILE.cfg JAN_01 VAR1=4 VAR2=SUM VAR3=PRIVATE JAN_10 VAR1=44 VAR2=GUN VAR3=NATUR JAN_20 VAR1=3 VAR2=TQN VAR3=COMMA code: (JAN_10 is argument passed from script) (6 Replies)
Discussion started by: Roozo
6 Replies

4. Shell Programming and Scripting

Issues with automating SFTP command

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)
Discussion started by: krackjack84
3 Replies

5. Shell Programming and Scripting

AWK Command to duplicate lines in a file?

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)
Discussion started by: Grueben
4 Replies

6. Shell Programming and Scripting

awk command in script gives error while same awk command at prompt runs fine: Why?

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)
Discussion started by: catalys
4 Replies

7. Shell Programming and Scripting

Automating 'newgrp' command - how?

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)
Discussion started by: moshmosh
2 Replies

8. Shell Programming and Scripting

awk/sed Command : Parse parameter file / send the lines to the ksh export command

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)
Discussion started by: rajan_san
4 Replies

9. Shell Programming and Scripting

Automating Logform Command in a script

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)
Discussion started by: TheDoc
2 Replies

10. Shell Programming and Scripting

How to run awk command having multiple lines

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)
Discussion started by: nani_g
0 Replies
Login or Register to Ask a Question