- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- Simple script but can't get it to work
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- 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
- Email to a Friend
- Report Inappropriate Content
03-30-2006 01:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP