Sponsored Content
Full Discussion: Escaping ** correctly
Top Forums Shell Programming and Scripting Escaping ** correctly Post 302394733 by brsett on Friday 12th of February 2010 10:42:51 AM
Old 02-12-2010
Escaping ** correctly

Hello

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

At the command line the following command works:

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

Doing that from a script is not straightforward. Note that it is basically a requirement that I place the includes and excludes into variables.

These alternatives do not work, as none of them produces the above output:

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

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?

Last edited by zaxxon; 02-12-2010 at 11:45 AM.. Reason: use code tags please, ty
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Escaping '*' in Bash

I have the following situation ============ export DirectoryName=/tmp/xyz if ; then some_new_env=$DirectoryName"/*" ======================= I tried all the ways of escaping the '*', but still the shell seems to expand the '*' character. I want some_new_env to contain "/tmp/xyz/*" ... (7 Replies)
Discussion started by: rkshukla14
7 Replies

2. Shell Programming and Scripting

escaping single quote

hi, echo 'abc' will give output abc how can i get output as 'abc' plz help. thanks in advance (3 Replies)
Discussion started by: javeed7
3 Replies

3. Shell Programming and Scripting

Escaping the * character in ksh.

Hi All, In ksh script i'm trying to assign "sqlstmt1" varaible value, update VAREntryTb set VAR10num = VAR1num * Mltplr where BusD = '$val1' and RunI = 1"` Hence i wrote below statement, the issue with this is shell is expanding "*" character adn thus subistuting it with the content of my... (6 Replies)
Discussion started by: arvindcgi
6 Replies

4. UNIX for Dummies Questions & Answers

Escaping backslash

I have a variable containt something like this, c:\mask\mask. How can I escape "\" in the values? I want the value as it it. (9 Replies)
Discussion started by: swmk
9 Replies

5. UNIX for Dummies Questions & Answers

Escaping comma with \ in file

Hi, I have pipe delimited file in which some of the description fields can have commas. e.g. 1|123|abc,def 2|456|qwert 3|345|aty,try,rty I need to convert this to a 'csv' file BUT i need to add \ before every comma present in the description values (so that my next program can read it as... (3 Replies)
Discussion started by: dsrookie
3 Replies

6. Shell Programming and Scripting

escaping '

I'm cleaning this from some html files style='' but when I try 's/style=\'\''//' I get an unmatched ' error (4 Replies)
Discussion started by: dba_frog
4 Replies

7. Shell Programming and Scripting

escaping path

Hi I use : path=/var/www/admin echo "$path" | sed -e 's/\//\\\//g' this return \/var\/www\/admin and is ok. but path2=`echo "$path" | sed -e 's/\//\\\//g'` echo $path2 return an error: sed: -e expression #1, char 9: unknown option to `s' Can anyone help me? Thanks (3 Replies)
Discussion started by: georgian
3 Replies

8. Shell Programming and Scripting

Escaping the \

So I understand that I should be able to ouput a literal \ by escaping it with a preceding \. My problem is that I am trying to ouput a script that will subsequently be run on a different system with UNC pathing, so I want to ouput two \\ in a row, but escaping them both in sequential order is not... (4 Replies)
Discussion started by: JourneyRider
4 Replies

9. UNIX for Beginners Questions & Answers

Gawk Escaping Ampersand

I would like to open a text m3u file and add the same string to the beginning of each line. I think I am close, but I cannot figure out how to escape the ampersand in the following code: gawk-3.1.6.exe "{print /var/media/Music2.0TB2.1USB/Audio Files/Music/Rock & Roll/ $0}" "L:\Music\Rock &... (7 Replies)
Discussion started by: WarpLover
7 Replies

10. Shell Programming and Scripting

Escaping Forward Slash

./split2.sh: line 1: split/ssl/pop3s.txt: No such file or directory sort: cannot read: split/ssl/pop3s.txt: No such file or directory Hi there, I am pulling data from the following source: ssl/http ssl/http ssl/http-alt ssl/https ssl/https ssl/https ssl/https ssl/https ssl/https... (3 Replies)
Discussion started by: alvinoo
3 Replies
FORWARD_STATIC_CALL_ARRAY(3)						 1					      FORWARD_STATIC_CALL_ARRAY(3)

forward_static_call_array - Call a static method and pass the arguments as array

SYNOPSIS
mixed forward_static_call_array (callable $function, array $parameters) DESCRIPTION
Calls a user defined function or method given by the $function parameter. This function must be called within a method context, it can't be used outside a class. It uses the late static binding. All arguments of the forwarded method are passed as values, and as an array, sim- ilarly to call_user_func_array(3). PARAMETERS
o $function - The function or method to be called. This parameter may be an array, with the name of the class, and the method, or a string, with a function name. o $parameter - One parameter, gathering all the method parameter in one array. Note Note that the parameters for forward_static_call_array(3) are not passed by reference. RETURN VALUES
Returns the function result, or FALSE on error. EXAMPLES
Example #1 forward_static_call_array(3) example <?php class A { const NAME = 'A'; public static function test() { $args = func_get_args(); echo static::NAME, " ".join(',', $args)." "; } } class B extends A { const NAME = 'B'; public static function test() { echo self::NAME, " "; forward_static_call_array(array('A', 'test'), array('more', 'args')); forward_static_call_array( 'test', array('other', 'args')); } } B::test('foo'); function test() { $args = func_get_args(); echo "C ".join(',', $args)." "; } ?> The above example will output: B B more,args C other,args SEE ALSO
forward_static_call(3), call_user_func(3), call_user_func_array(3), is_callable(3), information about the callback type. PHP Documentation Group FORWARD_STATIC_CALL_ARRAY(3)
All times are GMT -4. The time now is 05:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy