- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ksh program within backquotes won't work witho...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 09:06 AM
07-24-2007 09:06 AM
ksh program within backquotes won't work without having preceding "dot" (.)
I'm trying to help an Informatica PowerCenter (ETL tool) developer - and I'm out of ideas. Here's the scenario (3 files, all 777 perms until I resolve this):
ksh script -- /usr/local/bin/idpw -- has one line in it:
echo "MyID/MyPW"
ksh script -- /scripts/foo.WORKS -- has two lines in it:
idpw=`. /usr/local/bin/idpw`
echo $idpw
ksh script -- /scripts/foo.WONT_WORK -- has two lines in it:
idpw=`/usr/local/bin/idpw`
echo $idpw
BOTH SCRIPTS WORK FROM COMMAND-LINE (ksh).
But when the scripts are submitted thru Informatica tool, 2nd script returns NULL. All Informatica processes started with same ID/environment in which the commands work INTERACTIVELY.
What gives? Why is the "dot" REQUIRED for this to function? I wouldn't much care - except for the fact that we have a TON of legacy code that doesn't have the "dot" within the backquotes - and we'd rather not find and update all of those various scripts (even though, I know, find/sed would work for this).
Thanks in advance for any ideas/solutions!!!
Later,
Ben Chapman
bchapman@telcordia.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 09:19 AM
07-24-2007 09:19 AM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
What makes it a "ksh script" if it doesn't
have something like:
#!/bin/ksh
as its first line?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 09:24 AM
07-24-2007 09:24 AM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
e.g.
#!/usr/bin/ksh
echo "Stupid Stuff"
Of course, this assumes this PowerCenter stuff observes the shbang convention.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 09:44 AM
07-24-2007 09:44 AM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
That was stupid of me not to mention that - I just wanted to simplify/shorten the scripts for the post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 09:49 AM
07-24-2007 09:49 AM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
And this is where we're finding that the behavior is different - that is - backquoted script calls in shell scripts aren't being executed/interpreted/run/whatever.
We have opened a ticket with Informatica - and they (so far) have not been able to help out. Hence why I'm hitting up the gurus!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 10:00 AM
07-24-2007 10:00 AM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
idpw=$(. /usr/local/bin/idpw)
echo $idpw
or
idpw=$(/usr/local/bin/idpw)
echo $idpw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 10:10 AM
07-24-2007 10:10 AM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
And currently, all of our code has a BUNCH of lines with backquoted (tickquoted) programs:
#!/usr/bin/ksh
.
.
IdPw=`/usr/local/bin/get_id_pw.sh`
.
.
Which I know I can easily fix by using a dot (.), as in:
#!/usr/bin/ksh
.
.
IdPw=`. /usr/local/bin/get_id_pw.sh`
.
.
(or by using your more up-to-date convention)
#!/usr/bin/ksh
.
.
IdPw=$(/usr/local/bin/get_id_pw.sh)
.
.
But we're trying to avoid a massive code-update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 10:12 AM
07-24-2007 10:12 AM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
#!/usr/bin/ksh
eval echo "MyID/MyPW"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 10:15 AM
07-24-2007 10:15 AM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
I would add "set -x" just after your shbang lines in the called and calling scripts and observe the output. Note that the set -x output goes to stderr rather than stdout.
I would also try running as the POSIX shell #!/usr/bin/sh to see if the behavior changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 10:23 AM
07-24-2007 10:23 AM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
one line in it" actually has two lines in it,
and we really have no clear description of
what this "Informatica tool" really does with
the stuff you give it?
Knowing nothing, I'd say that you need to get
more info from the Informatica folks to find
out exactly what it does when you tell it to
do whatever you're telling it to do.
Particularly helpful might be knowing what
the new version does differently from the
older version(s). Trying to diagnose a
system which contains a black box along a
critical path sounds like a good task for a
talented psychic. (There may be one
following this thread, so you never know, but
my guess is that you'll need to find someone
who can peer into the black box.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 05:29 PM
07-24-2007 05:29 PM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
Psychics use quantum tunneling (tusc) to look into black boxes. ;-)
One difference about "." is that the file doesn't have to be executable. But Ben mentioned 777 permissions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2007 06:46 PM
07-24-2007 06:46 PM
Re: ksh program within backquotes won't work without having preceding "dot" (.)
I'd like to wether your backtic script is really executed:
add something like this to /usr/local/bin/idpw:
print i am idpw >/tmp/logfile$$
and watch for the logfile.
Maybe the stderr is devnulled by the calling environment so error messages are invisible?
mfG Peter