This script statements in certmgmt.sh-
update_keystore(){
keystore_file_path="/data/cert/keystore.jks"
kestore_password="pass@word"
temp_cert_path="/data/cert/temp_cert_file.cer"
cert_alias="root";
command="keytool -importcert -file $temp_cert_path -keystore $keystore_file_path -alias $cert_alias -keypass $kestore_password -storepass $kestore_password -noprompt"
$("$command")
}
This is the output of function execution
pz-active-user# /usr/certmgmt.sh update_keystore
usr/certmgmt.sh: line 1381: keytool -importcert -file /data/cert/temp_cert_file.cer -keystore /data/cert/keystore.jks -alias root -keypass pass@word -storepass pass@word -noprompt: No such file or directory
But if I run this directly from the terminal, it works.
pz-active-user# keytool -importcert -file /data/cert/temp_cert_file.cer -keystore /data/cert/keystore.jks -alias root -keypass pass@word -storepass pass@word -noprompt