Calling .sh(shell script) with the required parameters as below :-
sh home/example.sh --context_param dbUserName=username --context_param dbPassword=exam!ple##### --context_param resultDate=2017-01-13
calling example.sh with paramters dbUsername and password but getting following error:-
-bash: !ple#####: event not found
I think special characters restrict the command to execute. Then how i have to pass the special characters. Any help will be appreciable.
You can do the following two things:
Escape every single special symbol with a backslash
Singlequote the entire argument.
From
man bash
Change the line,
to,
to avoid
!
(history-expansion) being treated specially inbash
From
man bash
underQUOTING
sub-section,more under
HISTORY EXPANSION
Also, it is a good practice to quote all your
name-value
pairs to prevent Word-splitting done by shell.About word-splitting, from the
man
page,Pass it like this:
Test: