Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    how do I set quotes around a variable so that the programs sees them..

    I am trying to get quotes around a variable to make is just like I typed it in the terminal
    to get this script to work. it shows " quotes around the varibale "
    but still does not see it as quotes, as far as I can figure out because it does not work.

    	echo ${hs}${hex}
    	echo  "\" #${hex} \""
    	echo  "\"#${hex}\""
    	#one way trying
    	hsetroot -solid "\"${hs}${hex}\""
    	#another way of trying
    	hsetroot -solid "\""${hs}${hex}"\""
    either way I put the " qoutes " around the variable, as you can see they both come up with quotes on both sides, and it still does not work. Yet if I type the "#31064d" into the terminal putting it where it needs to be then it works.
     " #31064d "
     Bad color ("#31064d") 
     Bad color ("#31064d")
    this works it is a good color code
    userx@bw2-crunchbang:~/testscript$ hsetroot -solid "#31064d"
    HOW do I format it in script so a program that needs the pram to be in quotes sees it in quotes?

    	echo "\""#${hex}"\""
    	hsetroot -solid "\"#${hex}\""
    Bad color ("#12eba5")
    you see the " quotes " are still added around the numbers and letters like typing it into the terminal yet I get a nope, not working.

    I've tried the ' ' and the ` ` marks too, no go.
    Last edited by userx-bw; 12-16-2013 at 11:42 PM.

  2. #2
    I figured it out
    hsetroot -solid "#"${hex}""

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts