https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44244 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 212474 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212474&action=edit Bug 44244: Do not let koha-shell -c break on quotes in the command Bug 44244: Do not let koha-shell -c break on quotes in the command koha-shell built one string, ... -c '<command>', and ran it through a shell, so a single quote in the command ended the wrapper's quoting: koha-shell -c "echo 'Supplier load, August'" kohadev -> Supplier koha-shell -c "perl -e 'print(1)'" kohadev -> sh: 1: Syntax error: "(" unexpected The first is silently truncated: stage_file.pl --comment 'Supplier load, August' got --comment Supplier. The sudo command is now passed to system() as a list, so the command reaches the instance user's shell exactly as given. Test plan: 1. In KTD: sudo perl debian/scripts/koha-shell -c "echo 'Supplier load, August'" kohadev prints only "Supplier". sudo perl debian/scripts/koha-shell -c "perl -e 'print(qq{ok\n})'" kohadev sh: 1: Syntax error: "(" unexpected 2. Apply the patch, repeat 1: "Supplier load, August" and "ok". 3. Check nothing else changed: - koha-shell -c 'echo $KOHA_CONF; whoami' kohadev: the instance's koha-conf.xml and kohadev-koha - koha-shell -l -c 'echo $HOME; exit 3' kohadev; echo $?: the instance's home and 3 - koha-shell kohadev: an interactive shell as kohadev-koha in the current directory - koha-shell -v -c true kohadev prints the command Sponsored-by: Koha Solutions -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.