HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script to ignore numbers
Operating System - HP-UX
1834987
Members
1944
Online
110073
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
10-15-2003 01:02 PM
10-15-2003 01:02 PM
script to ignore numbers
Hi
Im using the command "ls -1 | awk '{print $NF}' | cut -f1 -d'.' | sort -u"
this command cuts the filename before period.
once I get the file I tar and gzip the files.
the files in directory are :
triton_int.Oct10.1 triton_int.Oct2.1 triton_int.out triton_int.Oct10.2 triton_int.Oct8.1 triton_int_06278.Sep24.1 triton_int_23669.Sep19.2 triton_int_25019.Sep25.1
triton_int_06726.Sep24.1
but whats happening is its creating a triton_int.tar.gz file which contains all the other files with *_int_0644... (that means numbers file as well) and it also creates a separate *.tar.gz file with numbers (i.e. triton_int_06726.tar.gz)but I don't want my script to create second gzip file.
What I want is get the filename before the period (thats what above command is doing) and if there are any numbers ignore them.
Thanks
Im using the command "ls -1 | awk '{print $NF}' | cut -f1 -d'.' | sort -u"
this command cuts the filename before period.
once I get the file I tar and gzip the files.
the files in directory are :
triton_int.Oct10.1 triton_int.Oct2.1 triton_int.out triton_int.Oct10.2 triton_int.Oct8.1 triton_int_06278.Sep24.1 triton_int_23669.Sep19.2 triton_int_25019.Sep25.1
triton_int_06726.Sep24.1
but whats happening is its creating a triton_int.tar.gz file which contains all the other files with *_int_0644... (that means numbers file as well) and it also creates a separate *.tar.gz file with numbers (i.e. triton_int_06726.tar.gz)but I don't want my script to create second gzip file.
What I want is get the filename before the period (thats what above command is doing) and if there are any numbers ignore them.
Thanks
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2003 03:00 PM
10-15-2003 03:00 PM
Re: script to ignore numbers
awk '{print $NF}' test |cut -f1 -d '.'|cut -f1,2 -d '_'|sort -u
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2003 03:11 PM
10-15-2003 03:11 PM
Re: script to ignore numbers
#ls|awk -F "." '{print $1}'|grep -v [0-9]
# ls|awk -F "." '{print $1}'|awk -F "_[0-9]" '{print $1}'
# ls|awk -F "." '{print $1}'|awk -F "_[0-9]" '{print $1}'
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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP