- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Rename file
Operating System - HP-UX
1752815
Members
5847
Online
108789
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
тАО09-20-2010 11:28 AM
тАО09-20-2010 11:28 AM
Hello All,
When i am ruuning the below command on command prompt its running fine.
paste pol_dsk disk_eux290|sed -e 's/ / to /g' -e 's/^/change /g'>rname.txt
But when running the same command in shell script rename.txt is not building.
Desired output
###########
change /dev/rdsk/c170t6d2 to /dev/rdsk/c66t7d6
change /dev/rdsk/c170t7d7 to /dev/rdsk/c66t7d7
###########
Getting the output while putiing in script.
#########
/dev/rdsk/c170t14d2 /dev/rdsk/c66t10d1
/dev/rdsk/c171t2d6 /dev/rdsk/c66t10d2
/dev/rdsk/c171t4d2 /dev/rdsk/c66t10d3
##########
To is getting missing & i thik there is TAB issue.
Regards
Ankit
When i am ruuning the below command on command prompt its running fine.
paste pol_dsk disk_eux290|sed -e 's/ / to /g' -e 's/^/change /g'>rname.txt
But when running the same command in shell script rename.txt is not building.
Desired output
###########
change /dev/rdsk/c170t6d2 to /dev/rdsk/c66t7d6
change /dev/rdsk/c170t7d7 to /dev/rdsk/c66t7d7
###########
Getting the output while putiing in script.
#########
/dev/rdsk/c170t14d2 /dev/rdsk/c66t10d1
/dev/rdsk/c171t2d6 /dev/rdsk/c66t10d2
/dev/rdsk/c171t4d2 /dev/rdsk/c66t10d3
##########
To is getting missing & i thik there is TAB issue.
Regards
Ankit
Solved! Go to Solution.
- Tags:
- paste
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2010 11:56 AM
тАО09-20-2010 11:56 AM
Solution
Hi:
Posting an attachment with your actual input would be more helpful than having us assume that it looks like.
Since you mention 'paste', you might want to specify the delimiter with '-d" "' which would declare it as a space and not a tab character.
The 'sed' command you show *appears* to try to match a space but that can't be ascertained from the way the Forum displays things. Since HP-UX 'sed' doesn't support the specification of the TAB characters with '\t' in 'sed' expressions, you might write:
# paste pol_dsk disk_eux290|sed -e 's/[ \t] / to /' -e 's/^/change /' > rname.txt
...where '\t' is actually replaced with the TAB character typed from the keyboard.
You might also do:
# paste -d" " pol_dsk disk_eux290|sed -e 's/ / to /' -e 's/^/change /' >rname.txt
...which is to say, specify the 'paste' delimiter.
In both cases, based on your input/output, the 'g'lobal replacement is superfluous.
Regards!
...JRF...
Posting an attachment with your actual input would be more helpful than having us assume that it looks like.
Since you mention 'paste', you might want to specify the delimiter with '-d" "' which would declare it as a space and not a tab character.
The 'sed' command you show *appears* to try to match a space but that can't be ascertained from the way the Forum displays things. Since HP-UX 'sed' doesn't support the specification of the TAB characters with '\t' in 'sed' expressions, you might write:
# paste pol_dsk disk_eux290|sed -e 's/[ \t] / to /' -e 's/^/change /' > rname.txt
...where '\t' is actually replaced with the TAB character typed from the keyboard.
You might also do:
# paste -d" " pol_dsk disk_eux290|sed -e 's/ / to /' -e 's/^/change /' >rname.txt
...which is to say, specify the 'paste' delimiter.
In both cases, based on your input/output, the 'g'lobal replacement is superfluous.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2010 04:06 PM
тАО09-20-2010 04:06 PM
Re: Rename file
Hi James
its worked for me.
Thanks for your solution.
Regards
Ankit
its worked for me.
Thanks for your solution.
Regards
Ankit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2010 04:08 PM
тАО09-20-2010 04:08 PM
Re: Rename file
Closing the thread.
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