Skip to main content

All Questions

6 votes
1 answer
3k views

Getting jq error when using variable in command line

I am using jq to get the tag_name index with the script: curl \ https://api.github.com/repos/checkstyle/checkstyle/releases \ -H "Authorization: token $GITHUB_TOKEN" \ -o /var/tmp/cs-...
Rahul Khinchi's user avatar
0 votes
3 answers
2k views

Which quoting style GNU Bash variable definitions (mostly for paths)? [closed]

Which of the following quoting styles, for GNU Bash variables, is preferred and why? Two double quotes: VAR="/path/$V1/path with space/$V2". Multiple double quotes: VAR=/path/"$V1"/"path with space"/"...
Klorax's user avatar
  • 244
1 vote
2 answers
6k views

Why is this environment variable not set up?

When a shell runs an external executable as a command, we can pass environment variables into the executable. $ var=3 /bin/echo `$var` $ var=3 bash -c "/bin/echo '$var'" both don't output anything. ...
Tim's user avatar
  • 103k
4 votes
0 answers
294 views

How to explicitly set the tabname of a new gnome-terminal?

I want to explicity rename a tab in gnome-terminal on startup of the tab. I don't want to use gnome-terminal --title flag as that gets reset by my systems bashrc file after whatever else is supposed ...
Prodnegel's user avatar
  • 141
2 votes
2 answers
1k views

Cannot run command inside bash variable including square brackets with nullglob

Assuming I want to run commnand stored inside the variable with nullglob turned on. For example: shopt -s nullglob a="echo [foo]bar" ${a} This gives me an empty output due to the nullglob option of ...
krab1k's user avatar
  • 23
4 votes
6 answers
25k views

How do I pass a variable from my local server to a remote server?

I am trying to pass a variable from my local server (location1) to a remote server (location2). The purpose of the code is to copy a file from the remote server from a predefined location. In simpler ...
Redson's user avatar
  • 573
2 votes
1 answer
5k views

bash: export: `--wait': not a valid identifier

When I run git-sh from my terminal it works fine. But I get the following warning. bash: export: `--wait': not a valid identifier What is this and how do I get rid of it?
ShivamD's user avatar
  • 141
3 votes
1 answer
370 views

Why does this variable have no value even though it is set in .bashrc?

If I append this: hi=11 export hi to the .bashrc and then I su to this user with: su - bela then I: echo $hi 11 Then it's working, the "hi" variable has the value of "11". But. When I: su -...
LanceBaynes's user avatar
  • 40.6k