Relative Content

Tag Archive for bashshell

Avoid double quotes removal in bash script (keep double quotes)

I have a run.sh script that is executing a java maven application, so it is passing some parameters the app needs, one of the parameters is a json string (dynamicOptionsJson is the param), but when I try to use this on the app I noticed some errors, checking the value of the String that I pass it prints as {bigqueryTable: table, dummyOption: hehexd} notice it is missing the double quotes of a properly formated json String, but I believe it is getting removed by the bash, please check the .env and run.sh I have:

Shell script: Not getting value of command evaluated in variable

path3=”a/b/c” command=”ls -1q ${!path3}* | wc -l ” length=”$(command)” echo $length I am trying to move to folder assigned to variable path3, I am not getting any value of length when executing this code. What is the issue in my code? I am expecting some value for length variable bash shell New contributor Prashant Kumar […]

bash scripting for file backup

i am trying to program a code for file backup using linux CLI bash shell but i keep getting a syntax error near unexpected token then' , if[$? -eq 0 ]; then ‘