I was trying to play around with escape characters in aliases.
Here's a simple example : I want to create an alias for
echo 'Hello'
So I wrote the alias like below :
alias sample 'echo \'Hello\' '
But I see this when I try to source the alias :
Unmatched '.
Any idea why this could be happening?
PS : I know I can use alias "echo 'Hello'"
, but I want to test out the escaping in aliases.
Any help is appreciated. Thanks!
bash
or any othersh
-like shell. It is however the correct syntax forcsh
ortcsh
. The lastalias
command is nonsensical though. The error message is identical to whatcsh
(but nottcsh
) would produce. Thebash
shell would not produce that error.csh
shell?