Skip to main content
added 208 characters in body
Source Link
themihai
  • 123
  • 1
  • 4

I'm having a hard time getting the value of an environment variable ($GHREPO) in a quoted string. Here is the command I'm running. I'm trying to make a directory with the value of j["ChgSub"][$GHREPO][0]["Major"], $GHREPO being an environment variable.

 mkdir `cat ../dummy.json | ruby -rjson -e 'j = JSON.parse($stdin.read); puts j["ChgSub"][$GHREPO][0]["Major"].to_s'` 

Edit: dummy.json content

{ "ChgSub": { "ecx": [ { "Major": 0, "Minor": 0, "Patch": 3 } ] } } 

I'm having a hard time getting the value of an environment variable ($GHREPO) in a quoted string. Here is the command I'm running. I'm trying to make a directory with the value of j["ChgSub"][$GHREPO][0]["Major"], $GHREPO being an environment variable.

 mkdir `cat ../dummy.json | ruby -rjson -e 'j = JSON.parse($stdin.read); puts j["ChgSub"][$GHREPO][0]["Major"].to_s'` 

I'm having a hard time getting the value of an environment variable ($GHREPO) in a quoted string. Here is the command I'm running. I'm trying to make a directory with the value of j["ChgSub"][$GHREPO][0]["Major"], $GHREPO being an environment variable.

 mkdir `cat ../dummy.json | ruby -rjson -e 'j = JSON.parse($stdin.read); puts j["ChgSub"][$GHREPO][0]["Major"].to_s'` 

Edit: dummy.json content

{ "ChgSub": { "ecx": [ { "Major": 0, "Minor": 0, "Patch": 3 } ] } } 
edited tags
Link
Gilles 'SO- stop being evil'
  • 866.5k
  • 205
  • 1.8k
  • 2.3k
Formatting and grammar.
Source Link
John WH Smith
  • 16.5k
  • 6
  • 54
  • 63

I haveI'm having a hard time to getgetting the value of an environment variable ($GHREPO) in a quoted string. Here is the command I'm running. I'm trying to make a directory with the variablevalue of j["ChgSub"][$GHREPO][0]["Major"]j["ChgSub"][$GHREPO][0]["Major"], $GHREPO being an environment variable.

 mkdir `cat ../dummy.json | ruby -rjson -e 'j = JSON.parse($stdin.read); puts j["ChgSub"][$GHREPO][0]["Major"].to_s'` 

I have a hard time to get the value of an environment variable ($GHREPO) in a quoted string. Here is the command I'm running. I'm trying to make a directory with the variable of j["ChgSub"][$GHREPO][0]["Major"], $GHREPO being an environment variable.

 mkdir `cat ../dummy.json | ruby -rjson -e 'j = JSON.parse($stdin.read); puts j["ChgSub"][$GHREPO][0]["Major"].to_s'` 

I'm having a hard time getting the value of an environment variable ($GHREPO) in a quoted string. Here is the command I'm running. I'm trying to make a directory with the value of j["ChgSub"][$GHREPO][0]["Major"], $GHREPO being an environment variable.

 mkdir `cat ../dummy.json | ruby -rjson -e 'j = JSON.parse($stdin.read); puts j["ChgSub"][$GHREPO][0]["Major"].to_s'` 
Source Link
themihai
  • 123
  • 1
  • 4
Loading