I have created an alias in UNIX in which regex is creating problem.
My intention is to use alias as _enable -input, the parameter should be passed with "-".
Not getting where the problem is.
alias is
alias _enable="function _enable() { [[ $1 =~ ^- ]] || { echo \"Use hyphen (-) before nodes.\"; return 1; } ; [[ $# = 1 ]] && { NODE=`echo ${1##*-}`; } || { NODE=\"\"; } ; $HOME/bin/command --command=enable --node=$NODE; }; _enable $1;"
The actual output is:
SS-04:~ # _enable 1
-bash: conditional binary operator expected
-bash: syntax error near `^-'