- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Executing a Perl Command
Operating System - HP-UX
1753901
Members
8581
Online
108810
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО12-22-2004 11:08 AM
тАО12-22-2004 11:08 AM
Executing a Perl Command
I want to ask how can i execute or call dos2ux or rm command inside perl?
Herewith is my part of the script:
datapath="/test/parset/data_files/finaltest/Temp"
npath="/temp/SAMPLE"
ExePath="/usr/bin"
perl="/opt/perl/bin"
cd $datapath
ls -l *.TDF |awk '{print $9}' |while read FILE
do
perl -e '$PerlVar=$ENV{Var};$PerlVar=~ m/^[0-9][0-9]*[\.[0-9][0-9]*]{0,1}$/g;if (pos($PerlVar)) {exec("$ExePath/dos2ux $FILE > $npath/$FILE")} else {exec "$ExePath/rm $FILE"}'
done
When I execute it, it displays an error:
sh: /: Cannot create the specified file.
sh: /: Cannot create the specified file.
Maximum point for all correct replies.
Herewith is my part of the script:
datapath="/test/parset/data_files/finaltest/Temp"
npath="/temp/SAMPLE"
ExePath="/usr/bin"
perl="/opt/perl/bin"
cd $datapath
ls -l *.TDF |awk '{print $9}' |while read FILE
do
perl -e '$PerlVar=$ENV{Var};$PerlVar=~ m/^[0-9][0-9]*[\.[0-9][0-9]*]{0,1}$/g;if (pos($PerlVar)) {exec("$ExePath/dos2ux $FILE > $npath/$FILE")} else {exec "$ExePath/rm $FILE"}'
done
When I execute it, it displays an error:
sh: /: Cannot create the specified file.
sh: /: Cannot create the specified file.
Maximum point for all correct replies.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 11:47 AM
тАО12-22-2004 11:47 AM
Re: Executing a Perl Command
might not be the reason, but
perl="/opt/perl/bin" then
perl -e ....
maybe your not using the version of perl you think you are.
you might check your quoting, double quotes inside of single quotes.
perl="/opt/perl/bin" then
perl -e ....
maybe your not using the version of perl you think you are.
you might check your quoting, double quotes inside of single quotes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 11:54 AM
тАО12-22-2004 11:54 AM
Re: Executing a Perl Command
Hi c,
I think the problem lies in this area:
{exec("$ExePath/dos2ux $FILE > $npath/$FILE")}
I dont know if i use the right command (system or exec) to execute the dos2ux command.
I think the problem lies in this area:
{exec("$ExePath/dos2ux $FILE > $npath/$FILE")}
I dont know if i use the right command (system or exec) to execute the dos2ux command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2004 12:09 PM
тАО12-22-2004 12:09 PM
Re: Executing a Perl Command
I found the solution. Thanks!
Am very new to perl and through searching in this forum found other solutions in perl "system" command by the other in this forum!
Am very new to perl and through searching in this forum found other solutions in perl "system" command by the other in this forum!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP