Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-21-2014, 08:23 AM   #1
LQ Newbie
Registered: Feb 2014
Posts: 3

Rep: Reputation: Disabled
STDOUT redirect to empty filename causing issues for some users.

We have a business application, in AIX server, which is executing the below line of code successfully. Note that the original developer did a mistake and didn't define the TFILE variable anywhere in the script. Though the TFILE variable is not defined anywhere, the script is running fine. We printed the TFILE value in the log files and verified that it's blank.

OUT_VALUE="$(/dev/bin/ 2> ${TFILE})"

However, when I execute the same script using my credentials, I am getting the below error

"/dev/bin/[425]: : cannot open".

'' is the script name which has the above mentioned line of code.

I can fix this error by defining the TFILE variable with some temp file name.

However, I would like to understand how the business application(it has it's own user credentials) is able to execute the same line of code without any error and why it's giving error for my user credentials.

I do not have much Linux experience and any help on this issue is highly appreciated.
Old 02-24-2014, 04:28 AM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
1. AIX is not Linux
2. it may also depend on which shell you're actually using; possibly 'sh' or 'ksh'.

Incidentally, on Linux under bash, an equivalent test gives 'ambiguous redirect'
Old 02-24-2014, 05:27 AM   #3
LQ Guru
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,671

Rep: Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855
you ought to define a default value for that variable. Also you need to use "${TFILE}" - with ".
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
STDOUT redirect to empty variable is working for some users, but some have issues. user237 Linux - Newbie 7 04-03-2014 12:02 PM
[SOLVED] Permanently redirect stdout picho Linux - Newbie 6 02-17-2012 05:46 PM
How to redirect standard stdout to multi stdout ( Bash )? john.daker Programming 4 11-03-2008 11:20 PM
syslog causing weird errors to be posted to stdout? checkmate3001 Linux - General 2 10-10-2007 01:35 AM
redirect stdout to a varible Furlinastis Programming 3 12-07-2005 06:01 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration