Hi Jose, Thanks. I understand that. I think, you can give a try the way I did.
Thanks & Best Regards -Nagendra, +91-9866424860 www.GetHighAvailability.com Get High Availability Today! NJ, USA: +1 508-507-6507 | Hyderabad, India: +91 798-992-5293 -----Original Message----- From: Tocino García, José Tomás [ELIMCO] [mailto:elimco.jttoci...@navantia.es] Sent: 07 May 2020 00:19 To: Nagendra Kumar; Opensaf-users@lists.sourceforge.net Subject: RE: <Externo> RE: [users] Spaces in arguments in ComponentType instantiate/cleanup/terminate commands Hi Nagendra. Thanks for answering. I've resorted to storing the parameters in a script that I call directly. I'm not sure I'm following the snippet you posted. I tried the same you did, moving the arguments to saAmfCtDefInstantiateCmdArgv and the results were the same. In your solution, when you print "$@" you're actually concatenating all the parameters, and even the quotes appear, which shouldn't. For example: $ cat test.sh echo $1 echo $2 echo $3 echo $@ $ bash test.sh "hello testing this" second third hello testing this second third hello testing this second third These are the expected results. The quotes should be removed by the shell and not passed to the script. Otherwise parsing to strip the quotes is needed. Regards. -----Mensaje original----- De: Nagendra Kumar <nagen...@hasolutions.in> Enviado el: martes, 5 de mayo de 2020 13:58 Para: Tocino García, José Tomás [ELIMCO] <elimco.jttoci...@navantia.es>; Opensaf-users@lists.sourceforge.net Asunto: <Externo> RE: [users] Spaces in arguments in ComponentType instantiate/cleanup/terminate commands Navantia Información de Seguridad: Este correo procede de una fuente externa. Extrema las medidas de precaución y no abras ningún enlace o fichero adjunto si no estás convencido de su seguridad y autenticidad. ________________________________ Hi Jose, Yes, I too found the same issue, subjected to debug further. But, there could be multiple workaround, which I attempted. One of them is to store the arguments in a file and then use parser to parse it. My configuration is like: <attr> <name>saAmfCtRelPathInstantiateCmd</name> <value>amf_demo_script</value> </attr> <attr> <name>saAmfCtDefInstantiateCmdArgv</name> <value>instantiate "/opt/simplepm/simplepm first" /var/run/simplepm_FIRST.pid</value> </attr> In amf_demo_script, I am getting the correct values as below: echo "$@" > /tmp/a logger -st $name "$binary Passed Arguements: `cut -d '"' -f2 < /tmp/a`" The output is: 2020-05-05T17:22:45.823667+05:30 VirtualBox amf_demo_script: /opt/amf_demo/amf_demo Initial Arguements: 4 , instantiate "/opt/simplepm/simplepm first" /var/run/simplepm_FIRST.pid 2020-05-05T17:22:45.829883+05:30 VirtualBox amf_demo_script: /opt/amf_demo/amf_demo Passed Arguements: /opt/simplepm/simplepm first If you check /tmp/a: root@nags-VirtualBox:/opt/amf_demo# cat /tmp/a instantiate "/opt/simplepm/simplepm first" /var/run/simplepm_FIRST.pid Hope it helps! Thanks & Best Regards -Nagendra, +91-9866424860 www.GetHighAvailability.com Get High Availability Today! NJ, USA: +1 508-507-6507 | Hyderabad, India: +91 798-992-5293 -----Original Message----- From: Tocino García, José Tomás [ELIMCO] [mailto:elimco.jttoci...@navantia.es] Sent: 04 May 2020 17:35 To: Opensaf-users@lists.sourceforge.net Subject: [users] Spaces in arguments in ComponentType instantiate/cleanup/terminate commands Hello. I have the following in the definition of a component type: <attr> <name>saAmfCtRelPathInstantiateCmd</name> <value>opt/ssaf/instantiate.sh "/opt/simplepm/simplepm first" /var/run/simplepm_FIRST.pid</value> </attr> I would expect instantiate.sh to receive two arguments, one containing the first quoted string, and another one with the second path. Instead, however, it receives three arguments: - "/opt/simplepm/simplepm - first" - /var/run/simplepm_FIRST.pid I've tried moving the arguments to saAmfCtDefInstantiateCmdArgv and the same happens. Looks like OpenSAF is splitting the command line regardless of the quotes. Is there a way to make it respect the quoted arguments? Thanks in advance. Regards. [Navantia] ________________________________ NAVANTIA S.A. S.M.E. Este mensaje y cualquier fichero anexo al mismo contiene información de carácter confidencial dirigida exclusivamente a su(s) destinatario(s) y, en su caso, sometida a secreto profesional. Queda prohibida su difusión, copia o distribución a terceros sin la previa autorización escrita. Si Vd. ha recibido este mensaje por error, se ruega lo comunique inmediatamente por esta misma vía y proceda a su completa eliminación. Puede revisar nuestra política de privacidad en http://www.navantia.es/es/legal/. The information in this e-mail and in any attachments is confidential and, if any, protected by a professional privilege and intended solely for the attention and use of the named address(es). You are hereby notified that any dissemination, copy or distribution of this information is prohibited without the prior written consent. If you have received this communication in error, please notify the sender by reply e-mail and delete it. You can review our privacy policy at http://www.navantia.es/en/legal/. ________________________________ [Navantia] Piense en el medio ambiente. ¿Necesita realmente imprimir este correo? Please care for the environment. Do you really need to print this e-mail? _______________________________________________ Opensaf-users mailing list Opensaf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-users _______________________________________________ Opensaf-users mailing list Opensaf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-users