HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Help script HP-UX
Operating System - HP-UX
1826916
Members
3207
Online
109705
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
Forums
Discussions
Discussions
Discussions
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
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
07-10-2008 08:22 AM
07-10-2008 08:22 AM
Help script HP-UX
Hi,
output command:
ls -tr /var/opt/ignite/recovery/archives/PJHPXC01 | grep 20
2008-07-10,12:11
2008-07-10,13:00
2008-07-10,14:00
i would like to send the output of this command and after i choose which file will be delete.
The script is attached.
wait
output command:
ls -tr /var/opt/ignite/recovery/archives/PJHPXC01 | grep 20
2008-07-10,12:11
2008-07-10,13:00
2008-07-10,14:00
i would like to send the output of this command and after i choose which file will be delete.
The script is attached.
wait
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2008 08:41 AM
07-10-2008 08:41 AM
Re: Help script HP-UX
Ok,
you have a script for your task.
- Do you want general comments?
One of me:
NUM_LINES1=`ls -tr $CAM1 | grep 20 | wc -w`
Change to
NUM_LINES1=$(ls -tr $CAM1/*20* 2>/dev/null | wc -w)
or
NUM_LINES1=$(ls -tr $CAM1 | fgrep -c 20)
or ...
- Does it not work generally?
- Does it not work under certain conditions?
mfG Peter
you have a script for your task.
- Do you want general comments?
One of me:
NUM_LINES1=`ls -tr $CAM1 | grep 20 | wc -w`
Change to
NUM_LINES1=$(ls -tr $CAM1/*20* 2>/dev/null | wc -w)
or
NUM_LINES1=$(ls -tr $CAM1 | fgrep -c 20)
or ...
- Does it not work generally?
- Does it not work under certain conditions?
mfG Peter
The Universe is a pretty big place,
it's bigger than anything anyone has ever dreamed of before.
So if it's just us, seems like an awful waste of space, right?
Jodie Foster in "Contact"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2008 11:09 PM
07-10-2008 11:09 PM
Re: Help script HP-UX
Over and over in your script you are doing that ls -tr, grep and wc. You can make this much easier by using select. In my case:
select file in $( ls -tr | grep 303 ) ; do
echo $file
break
done
Here is what I get, I then enter that "5".
1) 303471.log
2) 303595.i
3) 303595.incl
4) 303595.i.incl
5) 303750.i
6) 303879.txt
#? 5
303750.i
select file in $( ls -tr | grep 303 ) ; do
echo $file
break
done
Here is what I get, I then enter that "5".
1) 303471.log
2) 303595.i
3) 303595.incl
4) 303595.i.incl
5) 303750.i
6) 303879.txt
#? 5
303750.i
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.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP