I am not able to set alias of hexdump -e '/1 "%_ax) "' -e '/1 "%02X" "\n"'
I have tried following methods but failed:
alias analyze=\'hexdump -e '/1 "%_ax) "' -e '/1 "%02X" "\n"'\'
(note the first and last single quotes, I have escaped them both)
alias analyze='hexdump -e \'/1 "%_ax) "\' -e \'/1 "%02X" "\n"\''
(note in this case I have escaped all 4 single quotes in between the command)
alias analyze=hexdump -e '/1 "%_ax) "' -e '/1 "%02X" "\n"'
(not enclosing the command with quotes at all)
How do I set alias of hexdump -e '/1 "%_ax) "' -e '/1 "%02X" "\n"'
in bash?
analyze() { hexdump -e 'this' -e 'that' "$@"; }
– dave_thompson_085 Apr 30 '16 at 10:51hexdump: bad format {this}
– Alex Jones Apr 30 '16 at 15:12'this'
and'that'
should be the two singlequoted format strings you want (containing doublequotes), I didn't want to retype that cruft and maybe make a typo. My point is you already have quoting that works on commandline, and can use exactly the same in a function, but alias requires more complicated quoting. – dave_thompson_085 May 01 '16 at 06:34