LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 08: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, 04:28 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:52 PM.

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
Open Source Consulting | Domain Registration