Search Results

Search: Posts Made By: apmcd47
8,878
Posted By apmcd47
First, you need to quote your input: ./test.sh...
First, you need to quote your input:
./test.sh "[u/tmp/file.js, u/var/test.txt, u/tmp/llo.rft]"

Second, don't use the shell array construct - do this instead:
#!/bin/sh

FPATH="$1"

printf...
8,878
Posted By apmcd47
My original sed solution had a typo. This version...
My original sed solution had a typo. This version works for both the samples you gave, with and without the quotes:
#!/bin/sh

printf "Parameter 1: %s\n" "$1"
MYARRAY=`echo "$1" | sed 's/^\[//;...
8,878
Posted By apmcd47
But you are demonstrating bash constructs,...
But you are demonstrating bash constructs, particularly the string redirection, <<<.


You also need to quote each element of the python array:
$ python <<< "print ' '.join(['u/tmp/file.js',...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 03:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy