Search Results

Search: Posts Made By: apmcd47
2,846
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...
2,846
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/^\[//;...
2,846
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

 

Featured Tech Videos

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