What is the difference between the following two commands, when run on AIX?
/bin/sh 'ls -l -R'
/bin/sh -c 'ls -l -R'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
On AIX,
/bin/shdefaults to the Korn Shell (ksh).With ksh, this runs the shell, telling it to execute the script named
ls -l -R(in the current directory or on the path). If no script can be found with this name, ksh treats the argument as a command and runs it.Note that with bash, if the script cannot be found, this would result in an error.
This starts a new instance of the shell, telling it to run the command
ls -l -R.