5 ms·
One set of quotes (double quotes) allows for interpolation of commands/variables. Try: $ echo ‘pwd’ $ echo “pwd”
by sethammons 6y ago
One set of quotes (double quotes) allows for interpolation of commands/variables. Try:
$ echo ‘pwd’
$ echo “pwd”
- mauvehaus 6y agoYou're right, but it's neither of those for command interpolation. Double quotes enable variable expansion, single quotes do not. Command interpolation is back quotes, which is a carryover from sh. The more modern bash way is as follows: $ echo $(pwd) Incidentally: how does one type back quotes on an iPhone?! Edited to add: shellcheck [0] will flag the back quote usage if you're writing a bash script instead of a sh script. [0] https://www.shellcheck.net/ https://www.shellcheck.net/
- justusthane 6y agoLongpress single-quote.
- mauvehaus 6y agoThat ... lacks discoverability. `Thank you`!
- sethammons 6y agoLike most iPhone tips. How was I to discover long press space bar for cursor placement?! I like it, but discoverability...
- Tsiklon 6y agoIt was much better on the 3D Touch equipped models, press “through” the keyboard to get cursor placement, press “through” again while on a word to select the whole word.
- sethammons 6y agoThanks for the correction
- bewuethr 6y agoShellCheck always points out backticks as "legacy".