[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] parsing arguments with whitespaces



Hi Jose,

I ran into a similar problem not that long ago, but I was using variable substitution within DAGMAN
Maybe this link is helpful?
http://www.cs.wisc.edu/condor/manual/v7.5/2_10DAGMan_Applications.html#SECTION003106200000000000000
(see "Special characters within VARS string definitions")

At least with DAGMAN they say: Unfortunately, it is not possible to have single quote marks within these values. I only needed double quotes, but I eventually got it working with something like this:

Arguments=" -m var1 -p var2 -i 0.3 -s 0.5 -a 3.0 -n 1 -c \\\"1 2 3 4\\ \""

Notice the excessive escaping of the quotes.

Sorry I don't have an answer for you (and I didn't see your post sooner), but hopefully that gives you a lead to follow.

--Peter


On Feb 12, 2011, at 16:58 , Jose Caballero wrote:

Hello,

I have a bash script like this one  [1].
It works perfectly from the command line [2].
However, if I submit it with condor-G, with a file like [3], I get this error message [4].

I have tried with double quotes, single qoutes, scaping qoutes, etc. No luck.
Any tip or advice will be more than welcome.

Thank a lot in advance.
Jose


--------------------------------------------------------------------------------------------------------------
[1]
#!/bin/bash

parse_arguments(){

        for WORD in "$@" ; do
            case $WORD in
                --*)  true ;
                    case $WORD in
                        --name=*)
                                                NAME=${WORD/--name=/}
                                                shift ;;
                        --age=*)
                                                AGE=${WORD/--age=/}
                                                shift ;;
                        --address=*)
ADDRESS=${WORD/-- address=/}
                                                shift ;;
                        *) echo "Unrecognized argument $WORD"
                            ;;
                    esac ;;
*) echo "Option $WORD not starting with double dash."
                        ;;
            esac
        done
}

parse_arguments "$@"

echo "NAME = "$NAME
echo "AGE = "$AGE
echo "ADDRESS = "$ADDRESS

--------------------------------------------------------------------------------------------------------------
[2]

$ ./person.sh --name=Joe --age=45 --address='Springfield Av'
NAME = Joe
AGE = 45
ADDRESS = Springfied Av

--------------------------------------------------------------------------------------------------------------
[3]

universe  = grid
globusscheduler = my.grid.site/jobmanager-condor

executable = person.sh
arguments = "--name=Joe --age=45 --address='Springfield Av'"
transfer_executable = true

transfer_output = true
transfer_error  = true

output = job.$(Cluster).out
error  = job.$(Cluster).err
log    = job.$(Cluster).log

should_transfer_files = YES
when_to_transfer_output = ON_EXIT

queue

--------------------------------------------------------------------------------------------------------------
[4]

Option Av not starting with double dash.

_______________________________________________
Condor-users mailing list
To unsubscribe, send a message to condor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/condor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/condor-users/

Attachment: smime.p7s
Description: S/MIME cryptographic signature