$ # This string 'has single' "and double" quotes and a $ $ !:q '# This string '\''has single'\'' "and double" quotes and a $' bash: # This string 'has single' "and double" quotes and a $: command not found
Saw this bash trick discussion at: news.ycombinator.com/item?id=24659282 which has other suggestions like:
bash
!:q:p
!:q
M-^
Alt-Shift-6
bashquote() { printf '%q\n' "$(cat)" ; }
That's awesome! 🔥
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Saw this
bashtrick discussion at: news.ycombinator.com/item?id=24659282 which has other suggestions like:!:q:pprevents the complaint about command not found!:qand then pressingM-^(probablyAlt-Shift-6) to do the history expansion is probably more useful; then you can immediately edit the line.bashquote() { printf '%q\n' "$(cat)" ; }That's awesome! 🔥