- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- scripting help
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
12-11-2002 10:51 AM
12-11-2002 10:51 AM
Now that my mainpage has links to various system names, I need the sysinfo file to renamed to a standard file name so that the links work fine...
Here is what I am trying to do.
1. When sysinfo is run i get the following three files in the tmp directory
sysinfo_hpux_20020114
sysinfo_hpux_20020114.index
sysinfo_hpux_20020114.main
Assuming that this directory contains only the above three files. I need to do this..
2. Each time after the output is done, I need to rename the veryfirst file as sysinfo_hpux ..in otherwords i need to remove the datestamp from the file name.
can anyone help me do this..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 11:01 AM
12-11-2002 11:01 AM
Re: scripting help
a very simple _untested_ (no access to a machine today) script:
#! /usr/bin/ksh
cp sysinfo_hpux_[:digit:](\8\).index sysinfo_hpux.index
cp sysinfo_hpux_[:digit:](\8\).main sysinfo_hpux.main
cp sysinfo_hpux_[:digit:](\8\) sysinfo_hpux
Cheers,
FiX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 11:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 11:08 AM
12-11-2002 11:08 AM
Re: scripting help
sh: Syntax error: `(' is not expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 11:29 AM
12-11-2002 11:29 AM
Re: scripting help
If you captured the filename in a variable, 'X' then you can do this:
# mv $X `echo $X|sed -e 's/_[0-9]\{8\}//`
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 12:16 PM
12-11-2002 12:16 PM
Re: scripting help
thanks..it worked..but how do I do a listing which should display only the files names one after the other in a single column..it should not display permission, uid, gid date stamp etc..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 12:19 PM
12-11-2002 12:19 PM
Re: scripting help
# ls -l x1 #...that's a numeric "one" after the "x" columns.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 12:31 PM
12-11-2002 12:31 PM
Re: scripting help
Did u mean ls -x1??
ls -l x1 tries looks for a file x1 ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 12:36 PM
12-11-2002 12:36 PM
Re: scripting help
Yes, sorry, I meant:
# ls -x1 /tmp
Regards (...and I am JRF...)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 12:53 PM
12-11-2002 12:53 PM
Re: scripting help
AND YOU ARE JRF.. ;)