Register
It is currently Thu Oct 23, 2014 5:39 am

Escaping ** correctly


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Fri Feb 12, 2010 8:39 am   

Joined: Fri Feb 12, 2010 8:35 am
Posts: 2
Hello

This should be easy, but bash is giving me headaches.

At the command line the following command works:

duplicity --include /home --exclude '**' / file:///foo

Doing that from a script is not straightforward.

These alternatives do not work

args="--include /home --exclude '**'"
duplicity $args src tgt

args='--include /home --exclude **'
duplicity $args src tgt

args="--include /home --exclude \*\*"
duplicity $args src tgt

So what is the magic incantation, please?


Top
 Profile  
 PostPosted: Fri Feb 12, 2010 8:25 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 550
globstar might not be set in non interactive shell.
check it from the script
Code:
#!/bin/bash

shopt globstar


Top
 Profile  
 PostPosted: Mon Feb 15, 2010 10:47 am   

Joined: Fri Feb 12, 2010 8:35 am
Posts: 2
I found the help I needed here:

http://www.unix.com/shell-programming-s ... ectly.html


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP