- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Post Conversion script not working - copying part ...
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-30-2006 06:57 AM
05-30-2006 06:57 AM
Post Conversion script not working - copying part of log
The following script worked fine to copy every line from the current date forward:
datevar=$(date +'%b %e');
morevar="more -s /'$datevar' /dms/log/dms.log";
echo "$morevar" > temp.sh;
chmod +x temp.sh;
temp.sh > dmslog.$(date +%b%d);
rm temp.sh;
Now on the HP it copies the entire log. If I pick it apart and run everything manually, it works up to the "temp.sh > dmslog.$(date +%b%d);" line. For some reason it seems the redirection to a file causes it to choke, because if I just run the 'temp.sh' it outputs to the screen fine. Am I missing some HP scripting quirk?
- Tags:
- more
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2006 07:10 AM
05-30-2006 07:10 AM
Re: Post Conversion script not working - copying part of log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2006 07:51 AM
05-30-2006 07:51 AM
Re: Post Conversion script not working - copying part of log
Your script essentially executes 'more -s' against a file. In HP-UX, the '-s' switch of 'more' squeezes multiple blank lines into one on output. It doesn't filter anything else. Hence, your output is going to be the whole input file, less multiple blank lines as noted.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2006 08:29 AM
05-30-2006 08:29 AM
Re: Post Conversion script not working - copying part of log
OK, I think I see what you want:
In HP-UX you can use 'more +/pattern' to start listing a file two lines above the regular expression 'pattern':
# more +/$datevar filename
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2006 11:04 PM
05-30-2006 11:04 PM
Re: Post Conversion script not working - copying part of log
morevar="more -s +/'$datevar' /dms/log/dms.log";
I tried the suggestion by Christine and it didn't work.
Put in an echo to see how if the date is populated okay and it seems to look fine:
more -s +/'May 31' /dms/log/dms.log
It works from the command line but the script doesn't like it. A real head scratcher...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2006 11:08 PM
05-30-2006 11:08 PM