LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-21-2014, 09:23 AM   #1
user237
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/get.sh 2> ${TFILE})"

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

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

'load.sh' 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, 05:28 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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, 06:27 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

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


Reply


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 01:02 PM
[SOLVED] Permanently redirect stdout picho Linux - Newbie 6 02-17-2012 06:46 PM
How to redirect standard stdout to multi stdout ( Bash )? john.daker Programming 4 11-04-2008 12:20 AM
syslog causing weird errors to be posted to stdout? checkmate3001 Linux - General 2 10-10-2007 02:35 AM
redirect stdout to a varible Furlinastis Programming 3 12-07-2005 07:01 AM


All times are GMT -5. The time now is 05:53 AM.

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