Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Linux Software => Linux Application => Topic started by: mvas on November 15, 2011, 09:58:30 AM

Title: Ambiguous output redirect issue....
Post by: mvas on November 15, 2011, 09:58:30 AM
 ??? hi guys,

I'm trying to use a script that returns the name of the application server host that serviced the request.
I intend to use this one to check which server is used through the 3DNS call...
Calling this script repeatedly should cycle round the app servers within the JBOSS cluster.
(the box is using the csh shell)

curl -G --insecure "<URL goes here>" 2>/dev/null | awk ' BEGIN{FS="("}{ print $2 } ' | sed -e "s/).*//" 2>/dev/null

The script always return:
Ambiguous output redirect.

As you can figure out... scripts is not exactly my strong point....
I'm just trying to reuse this script, but in my case is not working...
Any ideas of whats wrong are more than welcome...

many thanks,

mike
Title: Re: Ambiguous output redirect issue....
Post by: gauravbajaj on December 21, 2011, 10:00:11 PM
Prob its shell problem ( not ur script) . I am pretty sure that csh doesn't like the redirection ( 2>/dev/null)

Try in bash it would work. If you need to run only in csh then try replacing ( 2>/dev/null)  with below
>& \dev\nul

and see it helps?