- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Unix korn shell scripting
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
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
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
07-09-2001 04:29 PM - last edited on 02-18-2013 07:26 PM by Cathy_xu
07-09-2001 04:29 PM - last edited on 02-18-2013 07:26 PM by Cathy_xu
Unix korn shell scripting
I left my scripting book at work and need a quick script to read in my text file and put the numbers in order which aren't necessarily at the beginning of the line. For instance, the text file looks like this:
Me9999ne
dog189
Horse8454
I want the new file to look like this:
Dog189
Horse8454
Me9999
Can someone please help me out here?
Thanks
P.S.This thread has been moved from Archived Desktops and Workstations Boards>general to HP-UX > languages-HP Forums Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 09:53 AM
07-10-2001 09:53 AM
Re: Unix korn shell scripting
I'm sorry, but I think the korn shell is not a good tool for your special case. I had a look an sed, awk, and tr, but I think if one of these tools would solve your problem, a lot of brain storming has to be done unless you're a very good expert in using regular expressions. See regexp(5).
If you have perl, try to use it. You need a script that examines each occurence in your file letter by letter (testing with e.g. \d or \D), and produces the desired output, and sorting it with the sort function before printing.
Maybe, others have better ideas.
Thomas