Redirection or piping error message


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Redirection or piping error message
# 1  
Old 05-06-2005
Redirection or piping error message

I have written a script that appears to work correctly in testing, but is coming up with a starnge error message,

script_name[187]: test: 0403-004 Specify a parameter with this command.

Redirection or piping of stdin or stdout is allowed only with -b. (156).

The script is run by different functions being called as seen below and the bit it seems to not like is marked in bold.

setup_environment

if [ -s ${shame_list} ]
then
rm ${shame_list}
fi

already_logged_in

if [ ${rejection} = yes ]
then
shame_on_you < $shame_list
fi

logon

A brief run down of the script is that it sets up all the environment variables, them checks to see whether there is a shame_list file and removes it, creates a list of who is logged on, then tries to import this list into a function which pulls out selected in formation.

Can anyone shed any light on why the error message is coming up as it has stumped me?
# 2  
Old 05-10-2005
Please post your OS and version, the scripting language, and how you are starting the script (since you state it's working in testing and then immediately state it's getting an error ) both in testing and when it's getting an error.

Also post the script (if possible) - this will assist the folks who can help you.

The only info I found on the error was here but I can't tell if that will help you or not.
# 3  
Old 05-10-2005
The second error seems to be related to something called "progress" link.

The first error is related to the old bourne shell test syntax. With code like:
if [ ${rejection} = yes ]
if the variable "rejection" is not set, the shell will see:
if [ = yes ]
so you need to use:
if [ "${rejection}" = yes ]
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Syntax error piping to bc on command line - works when assigned to var

I have a script which outputs some timing data a line at a time. There are approx. 10 lines echoed, each line looks something like this: 0.741 http://checkip.dyndns.org 94.170.119.226Since I needed to add all the values in the first column, I piped the output to grep, matching and printing the... (7 Replies)
Discussion started by: gencon
7 Replies

2. Shell Programming and Scripting

redirection error

Hi i am facing a very strange problem suppose the parameters which i passed to the script is -o 140 then my code is as follows echo $* | awk '{ for ( i=0;i<=NF;i++){if ($i= -o) { print ${i+1} } } ' | read abc echo $abc abc=`echo $* | awk '{ for ( i=0;i<=NF;i++){if ($i= -o) { print... (5 Replies)
Discussion started by: aishsimplesweet
5 Replies

3. Shell Programming and Scripting

Error with redirection in awk

I'm trying to find average of values in 2nd column in some files. Filenames have following pattern eg: tau_2.54_even_v1.xls tau_2.54_odd_v1.xls tau_1.60_v1.xls tau_800_v1.xls #!/bin/bash for file in pmb_mpi tau xhpl mpi_tile_io fftw ; do for f in "2.54" "1.60" "800" ;do if... (2 Replies)
Discussion started by: vishwamitra
2 Replies

4. Shell Programming and Scripting

output and error redirection

hi :) if condition >&- 2>&- Can anybody explain the redirection in above command Thanks in advance (1 Reply)
Discussion started by: jpriyank
1 Replies

5. Programming

Creating 3 process and piping a message

sorry im very new to this but i am supposed to create 3 processes A,B, and C and have a direct link from a to b, b to c, and c to a. here is my code. It does work, however if you look at what I bolded as long as my final read is p it seems to always work, regardless of the bolded section. ... (6 Replies)
Discussion started by: p00ndawg
6 Replies

6. Shell Programming and Scripting

sed error : Syntax error: redirection unexpected

My script is throwing the error 'Syntax error: redirection unexpected' My line of code.. cat nsstatustest.html | sed s/<tr><td align="left">/<tr><td align="left" bgcolor="#000000"><font color="white">/ > ztmp.Ps23zp2s.2-Fpps3-wmmm0dss3 HTML tags are getting in the way but they're needed to... (3 Replies)
Discussion started by: phpfreak
3 Replies

7. UNIX for Dummies Questions & Answers

error redirection

i am using 2> to redirect all the standard errors that i get in my bash script.. this command needs to be given in all the statements for which the errors are to redirected.. is there a command that will catch all the errors in all the shell commands that are present inside a script .? pls help.. (7 Replies)
Discussion started by: sais
7 Replies

8. Programming

Java with Unix (Redirection + Piping)

Hi, To explain this question I will have to go into a bit of detail. I hope you don't mind. currently I have a log handler (an already compiled c++ version) and what it does is makes a log file and writes all the unix output (echo, etc) of a script to that log file. To me the log_handler is... (3 Replies)
Discussion started by: fluke_perf
3 Replies

9. Programming

Piping and redirection implementation

To implement the facility of piping and redirection I used the two commands dup, dup2, and strtok for tokenizing the command. But when I run the command ls|more it is not running fine as I have developed it using the dup2 command. the more command needs the whole buffer at once. Please help... (7 Replies)
Discussion started by: mobile01
7 Replies

10. Shell Programming and Scripting

error piping nohup to /dev/null

Hi, I have a script as follows: #!/bin/sh nohup ./my_program >& /dev/null & However, i get a "Generated or received a file descriptor number that is not valid" whenever I run it. running the command up in prompt is ok though. if i change the first line to #!/bin/csh i get a then:... (4 Replies)
Discussion started by: mochi
4 Replies
Login or Register to Ask a Question