r - two layers of quotes around a bash variable -


i've written bash script makes series of r scripts. however, ive run difficulty quoting bash variable echo r script file read r. have

echo "loadings_file <- $loadings ; calls_file <- $file" | cat - template.r > temp && mv temp $scriptname 

$loadings , $file files want r read in. when run end in r script no quotes aroudn them r treat string. how make sure they're quoted in r still expanded in bash first?

echo "loadings_file <- '$loadings' ; calls_file <- '$file'" 

if need double quoting:

echo "loadings_file <- \"$loadings\" ; calls_file <- \"$file\"" 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -