- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Simple script but can't get it to work
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
Discussions
Discussions
Forums
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
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
тАО03-30-2006 12:34 AM
тАО03-30-2006 12:34 AM
#!/bin/bash
#/usr/bin/perl -e 'print "Changetime:".localtime((stat("$1"))[9])'
I simply want to type in the name and feed it a path and file neme for it to report on. If you harde code the $1 with a file name it works fine. Should you enter "# script /tmp/thisfile" it doesn't do the substituion and returns
Changetime:Wed Dec 31 19:00:00 1969
which is not correct.
Quick points!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 01:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 01:58 AM
тАО03-30-2006 01:58 AM
Re: Simple script but can't get it to work
From your reply it looks like you have to set it up as an environment variable before you can feed it to the script? I am presuming that the $ENV is some type of command that examines the environment, it then finds the variable set, and I have just fed the variable what I want it to look for so it does the substitution.
Is that anywhere correct? Isn't that like going around the corner to enter the door you're standing in front of?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 03:19 AM
тАО03-30-2006 03:19 AM
Re: Simple script but can't get it to work
#!/bin/bash
/usr/bin/perl -e 'print "Changetime:".localtime((stat("$ARGV[0]"))[9])' $1
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 04:00 AM
тАО03-30-2006 04:00 AM
Re: Simple script but can't get it to work
Thanks again