Sample Header Ad - 728x90

How to escape both single quotes and exclamation marks in bash

0 votes
3 answers
148 views
I have a long command and I just want to use alias to shorten it. But the command contains single quotes and exclamation marks. The origin command is ldapsearch -x -H ... -w 'abc!123'. I tried alias search='ldapsearch -x -H ... -w \'abc!123\'' or alias search="ldapsearch -x -H ... -w 'abc!123'" and so on. But none of them works for me.
Asked by Donghua Liu (103 rep)
May 31, 2024, 06:27 AM
Last activity: Nov 9, 2024, 01:34 PM