- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: parse and increment by 1
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
06-13-2001 12:07 PM
06-13-2001 12:07 PM
:20:00001
I'm trying to write a script that leaves the :20: at the beginning, but increases the 00001 by 1 each time I run it. I have this so far:
export F1=/jeff/test.dat
N='line < ${F1}'
N2='echo $N | awk -F: 'printf $3}' | sed 's/1/9/g''
N3=`expr ${N2} + 1`
echo "${N3}" > $F1
STAT=$?
exit ${STAT}
It's not quite working. Any help/ suggestions would be appreciated!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2001 12:29 PM
06-13-2001 12:29 PM
Re: parse and increment by 1
This is easy but I have one quick question.
Is the :20: constant or are you trying to have a file like this:
:20:000001
:30:000012
:40:000003
Does the file have separate counters or is this just the single entry? If you tell us that the rest is easy.
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2001 12:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2001 01:15 PM
06-13-2001 01:15 PM
Re: parse and increment by 1
1st time :20:00001
2nd time :20:00002
3rd time :20:00003
and so on...
Thank you very much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2001 01:17 PM
06-13-2001 01:17 PM
Re: parse and increment by 1
Thanks again!
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2001 01:58 PM
06-13-2001 01:58 PM
Re: parse and increment by 1
I attached a 2 minute script to do this. You may need to change the value of F1 to whatever your filename is.
Enjoy, Clay