Sponsored Content
Top Forums Shell Programming and Scripting for loop with internal unix command in statement throwing error Post 302667529 by jdilts on Friday 6th of July 2012 11:28:36 AM
Old 07-06-2012
[Solved] for loop with internal unix command in statement throwing error

Hi

I've gotten a plugin script that won't run. I keeps throwing an error at the following line.

Code:
for BARCODE_LINE in `cat ${TSP_FILEPATH_BARCODE_TXT} | grep "^barcode"`
do
#something
done

The error reads

/results/analysis/output/Home/Auto_KNO-12-Cardiac-panel_27_045/plugin_out/trial_out/ion_plugin_trial_launch.sh: line 146: syntax error near unexpected token `do
'
/results/analysis/output/Home/Auto_KNO-12-Cardiac-panel_27_045/plugin_out/trial_out/ion_plugin_trial_launch.sh: line 146: ` do
'

How can I get this for loop to ignore the backtick? (I tried using a semi-colon at the end of the statement)

Thanks

Last edited by jdilts; 07-06-2012 at 12:34 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

For loop statement - catch error

I'm having a question about for loops. (bash) I have the following for example: for file in `ls *.txt` do read file ... done Now when there is a file present there is no problem, now when there is no file present I get the following output in my standard mail box : "No such... (4 Replies)
Discussion started by: lumdev
4 Replies

2. UNIX for Dummies Questions & Answers

Remote login/copy command throwing an error

Hi We had 3 server -hp112and hp146 here hp112 is production server and hp146 is staging server used for load. when i am trying to run follwing command rcp abc hp112:/dnbusr1/gbid/gbid02 it's trowing an error :- remshd: Login incorrect. But same command is working wise versa - rcp abc... (1 Reply)
Discussion started by: ashish_panpalia
1 Replies

3. Shell Programming and Scripting

How to convert unix command into Awk statement

Hi all, How can i use the below unix command in AWK . Can any one please suggest me how i can use. sed -e "s/which first.sh/which \$0/g" $shell > $shell.sal where $0=current program name(say current.sh) $shell=second.sh (1 Reply)
Discussion started by: krishna_gnv
1 Replies

4. UNIX for Dummies Questions & Answers

forcefully throwing error : unix script

how can i make one script fail if some condition is not satisfied.i m writing if ..else logic in script.i need some standard command to do that ,, (1 Reply)
Discussion started by: dr46014
1 Replies

5. Shell Programming and Scripting

for loop throwing an error

Hi Guys, I am trying a simple for loop which is throwing an error. Below is my code: #/bin/sh set -A array "are" "you" "there"; for ( i = 0 ; i < ${#array} ; i++ ) do echo ${array} done I am getting this error tci001wasd02 $ sh -vx array_for.sh #/bin/sh set -A array "are"... (6 Replies)
Discussion started by: mac4rfree
6 Replies

6. UNIX for Dummies Questions & Answers

Mailx command in unix shell script, its throwing below error

How to use Mailx command in unix shell script, its throwing below error #!/bin/ksh let x=3 If ; then mailx -s “ $x is greater than 2” example@gmail.com << EOF This is the message body EOF fi its throwing error as syntax error at EOF... (10 Replies)
Discussion started by: only4satish
10 Replies

7. Shell Programming and Scripting

[Solved] FOR loop / IF statement returning error

The code at the bottom is a simplified example of what we have. If I use the following: && echo "echo failed" $? returns 1 When I use if ; then echo "echo failed" ; fi $? returns 0 Does anyone know what's wrong with this? Using AIX 6.1 and KSH for NUM in 1 2 3 do ... (5 Replies)
Discussion started by: jfxdavies
5 Replies

8. Shell Programming and Scripting

sed command throwing error while deleting a line from a file

Hi all, I ahve a program which has to delete a line in a file... if i run the sed command through shell prompt it works fine. But if run it using code its throwing error. May i know where i am doing wrong. the file has 3 lines # cat /root/.ssh/known_hosts... (4 Replies)
Discussion started by: vivek d r
4 Replies

9. Shell Programming and Scripting

For Loop throwing error

Hello Gurus, I am writing one script at linux. The logic is There is a find command which will find some specific files daily and store at a variable Then echo that variable . Now when I am trying to read the variable by using for loop it is throwing error as below:cat: CKDT.dat: No such... (5 Replies)
Discussion started by: pokhraj_d
5 Replies

10. Shell Programming and Scripting

Curl statement throwing extra statements

Hi all, I am running a curl statement in my script to extract some information form a remote server. My curl statement is : curl --socks5 142.133.134.164:1082 'http://11.229.52.71:8011/WebApp/common/version' This gives me an output of : $ curl --socks5 142.133.134.164:1082... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies
RIVET(1)							   User Commands							  RIVET(1)

NAME
rivet - Robust Independent Validation of Experiment and Theory SYNOPSIS
rivet [options] myfifo OPTIONS
--version show program's version number and exit. -h, --help show this help message and exit. -l NATIVE_LOG_STRS set a log level in the Rivet library. -a ANA, --analysis=ANA add an analysis to the processing list. --list-analyses show the list of available analyses' names. With -v, it shows the descriptions, too. --list-used-analyses list the analyses used by this command (after subtraction of inappropriate ones). --show-analysis=SHOW_ANALYSES, --show-analyses=SHOW_ANALYSES show the details of an analysis. --analysis-path=PATH specify the analysis search path (cf. $RIVET_ANALYSIS_PATH). --analysis-path-append=PATH append to the analysis search path (cf. $RIVET_ANALYSIS_PATH). --pwd append the current directory (pwd) to the analysis search path (cf. $RIVET_ANALYSIS_PATH). -H HISTOFILE, --histo-file=HISTOFILE specify the output histo file path (default = Rivet.aida). -x XS, --cross-section=XS specify the signal process cross-section in pb. -n NUM, --nevts=NUM restrict the max number of events to read. --runname=NAME give an optional run name, to be prepended as a 'top level directory' in histo paths. --ignore-beams Ignore input event beams when checking analysis compatibility. --event-timeout=NSECS max time in whole seconds to wait for an event to be generated from the specified source (default = 21600) --run-timeout=NSECS max time in whole seconds to wait for the run to finish. This can be useful on batch systems such as the LCG Grid where tokens expire on a fixed wall-clock and can render long Rivet runs unable to write out the final histogram file (default = unlimited). --histo-interval=HISTO_WRITE_INTERVAL [experimental!] specify the number of events between histogram file updates. Default is to only write out at the end of the run. Note that intermediate histograms will be those from the analyze step only: analysis finalizing is currently not executed until the end of the run. -v, --verbose print debug (very verbose) messages. -q, --quiet be very quiet. EXAMPLES
mkfifo hepmc.fifo my-generator -o myfifo & rivet --analysis=ANALYSIS_NAME hepmc.fifo ENVIRONMENT
: RIVET_ANALYSIS_PATH list of paths to be searched for plugin analysis libraries at runtime. RIVET_REF_PATH list of paths to be searched for reference data files. RIVET_INFO_PATH list of paths to be searched for analysis metadata files. AUTHOR
This manual page was written by Lifeng Sun <lifongsun@gmail.com> for the Debian system (but may be used by others). Rivet June 2012 RIVET(1)
All times are GMT -4. The time now is 12:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy