- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- using perl command in sh script cause error
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
05-27-2005 04:32 AM
05-27-2005 04:32 AM
i have hp-ux v 10.20
i writen sh script that interact with database.
this script contain perl command:
arch_date=`perl -e 'use POSIX qw(strftime);$ft=strftime"%d-%m-%y",localtime '$min';printf($ft)'`
i need this command to handle date.
may problem is:
when i execute this script through cron
the error messege appear in log file says
perl not found.
and when i execute this script manualy (from command line ) it works good.
i don't know what is different
please help
kamal
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2005 04:47 AM
05-27-2005 04:47 AM
Re: using perl command in sh script cause error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2005 04:47 AM
05-27-2005 04:47 AM
Solutionwhy use POSIX?
# arch_date=`perl -e'@l=localtime;printf"%02d-%02d-%4d",$l[3],$l[4]+1,$l[5]%100'`
If you *realy* want POSIX:
# arch_date=`perl -MPOSIX=strftime -e'print strftime"%d-%m-%y",localtime'`
Note that POSIX is slow.
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2005 04:48 AM
05-27-2005 04:48 AM
Re: using perl command in sh script cause error
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2005 05:38 AM
05-27-2005 05:38 AM
Re: using perl command in sh script cause error
how can i edit cron env.
and when i edit my script with path of perl location.
the same error appear.
please help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2005 06:04 AM
05-27-2005 06:04 AM
Re: using perl command in sh script cause error
#!/usr/bin/sh
export PATH=${PATH}:/opt/perl/bin
xxx=$(perl ....)
You may also need to add -Idir arguments to the Perl invocation so that it knows where to find any needed modules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2005 12:22 AM
05-28-2005 12:22 AM
Re: using perl command in sh script cause error
my script works fine now
kamal