RE: scripting problem
- From: "Mertens, Bram" <mertensb@xxxxxxxxxxxx>
- Date: Wed, 30 Jan 2008 09:30:12 +0100
Untill somebody uses a '=' sign in the name of a directory...
The IFS solution is probably a lot safer.
One other solution would be to make tar create several files with a
maximum size of 2G. If you want I'll post the scripts I use for this
but it's little more than an extended version of the example code in the
tar manual.
A basic example is explained at
http://www.cgi-interactive-uk.com/splitting_large_files.html, but more
examples can be found by googling "tar multi volume". The example
described on this page is interactive but you can also use a script for
this as explained on e.g.
http://cclib.nsu.ru/projects/gnudocs/gnudocs/tar/tar_137.html.
Regards
Bram
Mazda Motor Logistics Europe NV, Blaasveldstraat 162, B-2830 Willebroek
VAT BE 406.024.281, RPR Mechelen, ING 310-0092504-52, IBAN : BE64 3100 0925 0452, SWIFT : BBRUBEBB
-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Steven Buehler
Sent: maandag 28 januari 2008 22:22
To: 'General Red Hat Linux discussion list'
Subject: RE: scripting problem
Perfect. Thank You SO MUCH. That did the trick.
Steve
-----Original Message-----spaces for the
From: redhat-list-bounces@xxxxxxxxxx [mailto:redhat-list-
bounces@xxxxxxxxxx] On Behalf Of Broekman, Maarten
Sent: Monday, January 28, 2008 3:09 PM
To: General Red Hat Linux discussion list
Subject: RE: scripting problem
You could push the ls output through sed to remove the
for-loop and then again when you are inside the loop.use tar to
DIRSTOBACKUP=`/bin/ls -d1 /home/user/* | /bin/sed -e 's/ /=/g'`
for NAMEDIR in ${DIRSTOBACKUP[@]}
do
DIR=`echo $NAMEDIR | /bin/sed -e 's/=/ /g'`
echo $DIR
done
It's a bit round-about but it'll get around the spaces.
Maarten Broekman
-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Aaron Bliss
Sent: Monday, January 28, 2008 4:01 PM
To: General Red Hat Linux discussion list
Subject: Re: scripting problem
Steve,
The easiest way to work around the space problem is to just
backup the home directory.am running a
Aaron
Steven Buehler wrote:
I am hoping that someone here can help me with this. I
littlesnippet that
script that backs up some directories for me. Below is
gets mein the names.
into trouble.
---------------------
#!/bin/sh
DIRSTOBACKUP=`/bin/ls -d1 /home/user/*`
for NAMEDIR in ${DIRSTOBACKUP[@]}
do
echo $NAMEDIR
done
---------------------
The problem is that some of the directories have spaces
Whenspace. So
running the for loop, it will take the new NAMEDIR at the
"Red"Hat". Any way
Hat" would end up listing as 2 directories, "Red" and
aroundmailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
this?
Thanks
Steve
--
Aaron Bliss
Systems Administrator
SUNY Brockport
(585) 395-2417
--
redhat-list mailing list
unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-listmailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
--
redhat-list mailing list
unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
- References:
- scripting problem
- From: Steven Buehler
- Re: scripting problem
- From: Aaron Bliss
- RE: scripting problem
- From: Broekman, Maarten
- RE: scripting problem
- From: Steven Buehler
- scripting problem
- Prev by Date: Re: DNS Configure
- Next by Date: Block PC using Mac address in squid
- Previous by thread: RE: scripting problem
- Next by thread: RE: scripting problem
- Index(es):