- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: renaming files
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
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
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
тАО09-17-2009 01:41 AM
тАО09-17-2009 01:41 AM
renaming files
i want replace recusive all my files data-source.xml.pass with data-source .xml
form line command i can do it:
filename=/u10/app/oracle/10.1.2/esbiforms/j2ee/home/config/data-sources.xml.pass
newv=${filename%.*}
echo $newv
/u10/app/oracle/10.1.2/esbiforms/j2ee/home/config/data-sources.xml
but in a loop this not run for: bud sustitution
Can you help me?
thanks.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2009 01:53 AM
тАО09-17-2009 01:53 AM
Re: renaming files
could you please show us the loop?
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2009 02:11 AM
тАО09-17-2009 02:11 AM
Re: renaming files
I tried an empty string and one without any "." and I didn't get that "bad substitution" error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2009 02:20 AM
тАО09-17-2009 02:20 AM
Re: renaming files
thi t's my loop:
for i in `cat /home/as10g/lista_data_sources_pass.lst`
do
filename=$i
newvariable=${filename%.*.*}
echo $newvariable
done
======================
extract
solpro07:/usr/local/oracle> cat /home/as10g/lista_data_sources_pass.lst
/u10/app/oracle/10.1.2/esbiforms/j2ee/home/config/data-sources.xml.pass
/u10/app/oracle/10.1.2/esbiforms/j2ee/OC4J_BI_Forms/config/data-sources.xml.pass
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2009 02:25 AM
тАО09-17-2009 02:25 AM
Re: renaming files
"recambio.sh" 10 l├Г┬нneas, 170 caracteres
for i in `cat /home/as10g/lista_data_sources_pass.lst`
do
echo $i
filename=$i
echo $filename
echo ${filename%.*}
newvariable=${filename%.*.*}
echo $newvariable
done
======
result:
======
solpro07:/usr/local/oracle> sh recambio.sh
/u10/app/oracle/10.1.2/esbiforms/j2ee/home/config/data-sources.xml.pass
/u10/app/oracle/10.1.2/esbiforms/j2ee/home/config/data-sources.xml.pass
recambio.sh: sustituci├Г┬│n err├Г┬│nea
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2009 02:38 AM
тАО09-17-2009 02:38 AM
Re: renaming files
What locale are you using?
echo $LANG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2009 02:54 AM
тАО09-17-2009 02:54 AM
Re: renaming files
dont'have $LANG
but it's all spanish
LC_COLLATE=es_ES.ISO8859-15
LC_NUMERIC=es_ES.ISO8859-15
LC_MESSAGES=es
LC_MONETARY=es_ES.ISO8859-15
LC_TIME=es_ES.ISO8859-15
I use Ksh
thanks.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2009 01:21 AM
тАО09-18-2009 01:21 AM
Re: renaming files
I didn't try that exact locale before but it still doesn't fail with those. What OS version do you have? Any ksh patches?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2009 01:27 AM
тАО09-18-2009 01:27 AM
Re: renaming files
i have do it the renaming with other commands.
thanks to all
Francesco