Bugzilla – Bug 679
sudo -i ignores empty arguments
Last modified: 2017-04-12 08:38:43 MDT
Here is an example bash script that I would like to run using `sudo -i`: #!/bin/bash echo "arg 1: $1" echo "arg 2: $2" When I run this command normally with one empty argument, it runs as expected: $ /tmp/args.sh "" two arg 1: arg 2: two With plain sudo, I get the expected result: $ sudo /tmp/args.sh "" two arg 1: arg 2: two However if I use `-i` (to pick up the user's shell and login scripts), suddenly the first argument disappears: $ sudo -i /tmp/args.sh "" two arg 1: two arg 2: Current workarounds are: * writing `/tmp/args.sh "" two` to a file and then executing that with `sudo -i` * run: sudo -i bash -c '/tmp/args.sh "" two' Stack Overflow: http://stackoverflow.com/questions/27892812/passing-empty-arguments-to-sudo-i