- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Environment variables2
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
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
тАО10-16-2001 10:33 PM
тАО10-16-2001 10:33 PM
Environment variables2
I need to pass two parameters:
a) The files stating with "X_" and
b) Retained time for deleting the renamed file (or) Retained time for deleting the non-renamed file.
(ie.,Time based)
Note: That means users will FTP from the remote server to the local server.So once the file is in the local server it will be renamed to "X_
so If i pass the paramters like
variable1= X_ and time=1 (ie 1 hour)
It has to check the two conditions and file has to be deleted. I mean if i pass these above two parameters it has to satisfy the two conditions....
Is it possible like that to develop a shell script like that..
I have attached the document which i recieved from FAQ
Regards
Rajkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2001 01:20 AM
тАО10-17-2001 01:20 AM
Re: Environment variables2
I forgot to attach a document ..Please advise..
Is it possible to read those above mentioned paramters from the CONFIG file or INI file ???
Thanks for the advance inhelp..
Regards
Rajkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2001 01:33 AM
тАО10-17-2001 01:33 AM
Re: Environment variables2
just a little note:
the find command parameters atime, ctime, mtime work with multiples of 24 hours (days) not with single hours!
So if you want to delete files after one or a few hours one small find statement will not be sufficient :(
regards,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2001 01:38 AM
тАО10-17-2001 01:38 AM
Re: Environment variables2
I forgot to attach a document..
Is it possible to collect the paramters from the CONFIG file or INI file and delete accordingly.
Please provide me a script..
I have attached a shell script that i recieved from the ROBIN....
Thanks from the advance in help...
Rajkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2001 02:23 AM
тАО10-17-2001 02:23 AM
Re: Environment variables2
Thank you for your reply..
Yes you are correct..It works with multiple hours..
Is it possible to read the values (starting letter X or Y and hours) from the CONFIG file or INI file???
Because it was hardcoded in the config ir ini file..
Note: user may change the prefix X or Y.. and
hours =3 or 5 etc... or If it is not possible in hours it should be in seconds..
If the script can able to read those values from the config or ini file so it will work...
Can you provide me a script???
Thanks & Regards
Rajkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2001 04:55 AM
тАО10-17-2001 04:55 AM
Re: Environment variables2
Yes, just create a script, say, ~/.config that says:
DAYS=3
VAR="X_"
In your main script, source this file:
. ~/.config
Then these variables will be set, so you could then say:
find $DIR -name "${VAR}*" -mtime +$DAYS ...
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2001 07:37 AM
тАО10-17-2001 07:37 AM
Re: Environment variables2
if you want to get values from a CONFIG file into your script, there are many ways of doing this:
VALUE="$(grep '^PARAMNAME=' /you/config/file | cut -d= -f2-)"
seems to be a very simple and safe one.
Later in your script just refer to it as "$VALUE"...
HTH,
Wodisch