- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Problem with white space in file names
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-15-1999 05:18 AM
12-15-1999 05:18 AM
Problem with white space in file names
work around for this.
We have an HP 9000 running HP-UX 11 that we are running an application (Oracle)
database on. The user has a directory NFS mounted onto this machine that (I
think but don't quote me) originates on a Windows NT server somewhere. I've
been asked to backup this NFS mounted directory at the same time as I backup
the database... which would normally not be a problem.
My normal backup script takes care of the backup and places the backup files
(either an Oracle export or copies of our Oracle database files depending on
what kind of backup has been performed) to where our Unix Administrator has
configured his backup software to worry about these files. The NFS mounted
directory is ignored by his sofeware. So I added a subscript to copy the files
to an appropriate directory. Now I've gotten into the habbit of using for
loops when moving groups of files around because I don't get a copy, remove or
move command trying to walk a directory tree when all I want to do is work on
the files in a given directory. My working script looks like the following.
for AL in `ls /dirname2/ | awk -F '{ print $1 }'`
do
rm /dirname2/${AL}
done
for AL in `ls /dirname1/ | awk -F '{ print $1 }'`
do
mv /dirname1/${AL} /dirname2
done
for AL in `ls /NFSdirname/ | awk -F '{ print $1 }'`
do
cp /NFSdirname/${AL} /dirname1
done
The problem is that some of the NFS mounted files have file names with
whitespace in them.
For example: "The last file accessed.xls" could be a file name and the "for"
interprets this as four distinct names instead of one name.
Any suggested work arounds to this would be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-1999 05:55 AM
12-15-1999 05:55 AM
Re: Problem with white space in file names
find /dirname/ -name whatever\* -exec mv {} /newdir \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-1999 06:52 AM
12-15-1999 06:52 AM
Re: Problem with white space in file names
also take care of the need to loop. Also takes care of the white space
problem.
For example: "find / -name "app*" or
"find / -name "*app*".. You can really get creative here.
Rich
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-1999 10:48 AM
12-15-1999 10:48 AM
Re: Problem with white space in file names
buy OmniBack, you will pay for the cell server, plus licenses for concurrent
tape drives, plus client license for NT servers: about $5000 U.S.
- back up all HP-UX data without the extra copy step
- back up NT data directly from the NT box without the extra copy ( could you
restore it to the NT box?)
- do cold backups of the Oracle database with no copy step
- after alot of hard work studying Oracle Record Manager, Oracle/Omniback
Integration you can do hot backups directly to tape (sans export files) but
don't think that it is easy
- automatic log creation/management
- ability to intuitively search logs
- tape management (given the directory and the date on which it was backed up,
what tape is it on?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-1999 08:14 PM
12-15-1999 08:14 PM
Re: Problem with white space in file names
You could rewrite your script like this:
for AL in /dirname2/*
do
rm "${AL}"
done
for AL in /dirname1/*
do
mv "${AL}" /dirname2
done
for AL in /NFSdirname/*
do
cp "${AL}" /dirname1
done
or rewrite to:
cd /dirname2
rm -rf *
cd /dirname1
find . -print | cpio -pudvmx /dirname2
rm -rf *
cd /NFSdirname
find . -print | cpio -pudvmx /dirname1
good luck
Jesper Sivertsen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-1999 10:31 PM
12-15-1999 10:31 PM
Re: Problem with white space in file names
Thank you for your response.
I was not looking for either an advertisement to purchase OmniBack or
suggestions for the local UNIX administrator on how he should do his job
however.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-1999 10:37 PM
12-15-1999 10:37 PM
Re: Problem with white space in file names
Thank you for your response.
Nice suggestion and I did investigate the possibility myself. I could not get
it to work very satisfactorally however... my own inexperience I am sure.
I found Jesper Sivertsen's suggestion to be the most helpful.
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-1999 10:41 PM
12-15-1999 10:41 PM
Re: Problem with white space in file names
Thank you for your response.
I did investigate using the find command myself but was not successful in
producing any satisfactory results... my own inexperience perhaps?
I found Jesper Sivertsen's suggestions to be the most applicable however.
David