- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Command Substitution is not working
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
01-03-2006 05:49 PM
01-03-2006 05:49 PM
Command Substitution is not working
eg.
but
The same works on other servers. Perl instalation, version, modules etc is all the same. | works on command prompt but not via programs
$ uname -a
HP-UX Server_Name B.11.11 U 9000/800 1849201262 unlimited-user license
$ perl -v
This is perl, v5.8.7 built for PA-RISC2.0-thread-multi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2006 06:05 PM
01-03-2006 06:05 PM
Re: Command Substitution is not working
perl -e '$var=`ls | wc -l`;print $var;'
It has to work.
-Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2006 06:19 PM
01-03-2006 06:19 PM
Re: Command Substitution is not working
It doesn't work
testsw /home/testsw>perl -e '$var=`ls | wc -l`;print $var;'
testsw /home/testsw>
but
testsw /home/testsw>perl -e '$var=`ls`;print $var;'
a.pl
data
ftpdtls.txt
ftpuploaddtls.txt
getPatchInfo
getclientdetails.pl
maintainhash
maintainhashcron.sh
nohup.out
setdistenv
testing.sh
testsw /home/testsw>
So i'm back to where I was, the | doesn't work from perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2006 07:07 PM
01-03-2006 07:07 PM
Re: Command Substitution is not working
# perl -We '$var=`ls | wc -l`;print $var;'
# perl -We '$var=qx[ls | wc -l];print $var;'
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2006 07:24 PM
01-03-2006 07:24 PM
Re: Command Substitution is not working
what is with the other pipe-operators (<,>,|)?
does this works?
#perl -e '`ls > list`;'
#cat list
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2006 11:58 PM
01-03-2006 11:58 PM
Re: Command Substitution is not working
Perhaps it's not a problem with perl, but with the environment you're running it in. What shell are you running on the system that doesn't work, and what on the systems that do?
What is the output of 'stty -a' on the non-working and working systems?
What happens if you put the line in a file, and run that (e.g. put the line in a file and run the file with 'sh /tmp/filename' or even 'sh -x /tmp/filename')?
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2006 02:21 AM
01-04-2006 02:21 AM
Re: Command Substitution is not working
run "stty -a" and see if you see a "|" symbol in there.