- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script to sequence log files
Operating System - HP-UX
1754940
Members
2856
Online
108827
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
Discussions
Discussions
Forums
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
тАО05-21-2004 02:54 AM
тАО05-21-2004 02:54 AM
Solution
Hi,
I think I have your code working. I think the trick is around the typeset command and the octal problem mentioned. I got it to work by using another variable to calculate the number, and then setting the variable N to that number.
Something like this:
typeset -Z2 N
T=0
for F in $FILE_LIST
do
(( T=(T+1)%60 ))
N=$T
mv ${F} $DEST/${N}${F}
done
It looks like your arithmetic expression works, but not with a variable where you have the typeset for -Z2.
JP
I think I have your code working. I think the trick is around the typeset command and the octal problem mentioned. I got it to work by using another variable to calculate the number, and then setting the variable N to that number.
Something like this:
typeset -Z2 N
T=0
for F in $FILE_LIST
do
(( T=(T+1)%60 ))
N=$T
mv ${F} $DEST/${N}${F}
done
It looks like your arithmetic expression works, but not with a variable where you have the typeset for -Z2.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-21-2004 03:01 AM
тАО05-21-2004 03:01 AM
Re: script to sequence log files
typeset -Z2 N=
for F in $FILE_LIST
do
(( N=N+1 ))
[[ $N -gt 60 ]] && N=0
[[ $N -le 10 ]] && N="0$N"
Hope that should work.
Regards,
for F in $FILE_LIST
do
(( N=N+1 ))
[[ $N -gt 60 ]] && N=0
[[ $N -le 10 ]] && N="0$N"
Hope that should work.
Regards,
You need to know a lot to actually know how little you know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-23-2004 07:43 PM
тАО05-23-2004 07:43 PM
Re: script to sequence log files
That works John, thanks!
- « Previous
-
- 1
- 2
- Next »
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP