[Lldb-commits] [PATCH] Convert remaining instances of '/bin/bash' to '/bin/sh'

Greg Clayton gclayton at apple.com
Tue Sep 3 09:50:17 PDT 2013


Since we mention the default shell in many different locations it would be a good idea to get the default shell into a #define in the lldb-defines.h file and then have everyone use that.


On Sep 2, 2013, at 7:00 AM, Ed Maste <emaste at freebsd.org> wrote:

> As jmolenda points out in r189703 systems like OS X and Linux which may install bash by default typically install it as /bin/sh as well.  BSDs generally do not have a /bin/bash and have a traditional Bourne shell /bin/sh.  So always use /bin/sh for compatibility.
> 
> http://llvm-reviews.chandlerc.com/D1576
> 
> Files:
>  include/lldb/Host/Host.h
>  source/Interpreter/CommandInterpreter.cpp
>  source/Target/Process.cpp
>  test/functionalities/alias/TestAliases.py
>  test/pexpect-2.4/doc/index.html
>  test/pexpect-2.4/doc/index.template.html
> 
> Index: include/lldb/Host/Host.h
> ===================================================================
> --- include/lldb/Host/Host.h
> +++ include/lldb/Host/Host.h
> @@ -473,8 +473,7 @@
>                      int *signo_ptr,                // Pass NULL if you don't want the signal that caused the process to exit
>                      std::string *command_output,   // Pass NULL if you don't want the command output
>                      uint32_t timeout_sec,
> -                     const char *shell = "/bin/sh"
> -                    );
> +                     const char *shell = "/bin/sh");
> 
>     static lldb::DataBufferSP
>     GetAuxvData (lldb_private::Process *process);
> Index: source/Interpreter/CommandInterpreter.cpp
> ===================================================================
> --- source/Interpreter/CommandInterpreter.cpp
> +++ source/Interpreter/CommandInterpreter.cpp
> @@ -318,7 +318,7 @@
> #if defined (__arm__)
>         ProcessAliasOptionsArgs (cmd_obj_sp, "--", alias_arguments_vector_sp);
> #else
> -        ProcessAliasOptionsArgs (cmd_obj_sp, "--shell=/bin/bash --", alias_arguments_vector_sp);
> +        ProcessAliasOptionsArgs (cmd_obj_sp, "--shell=/bin/sh --", alias_arguments_vector_sp);
> #endif
>         AddAlias ("r", cmd_obj_sp);
>         AddAlias ("run", cmd_obj_sp);
> Index: source/Target/Process.cpp
> ===================================================================
> --- source/Target/Process.cpp
> +++ source/Target/Process.cpp
> @@ -816,7 +816,7 @@
>             if (option_arg && option_arg[0])
>                 launch_info.SetShell (option_arg);
>             else
> -                launch_info.SetShell ("/bin/bash");
> +                launch_info.SetShell ("/bin/sh");
>             break;
> 
>         case 'v':
> Index: test/functionalities/alias/TestAliases.py
> ===================================================================
> --- test/functionalities/alias/TestAliases.py
> +++ test/functionalities/alias/TestAliases.py
> @@ -109,16 +109,16 @@
> 
> 
>         self.expect ("help run",
> -                     substrs = [ "'run' is an abbreviation for 'process launch -c /bin/bash --'" ])
> +                     substrs = [ "'run' is an abbreviation for 'process launch -c /bin/sh --'" ])
> 
>         self.expect ("help -a run",
> -                     substrs = [ "'run' is an abbreviation for 'process launch -c /bin/bash --'" ])
> +                     substrs = [ "'run' is an abbreviation for 'process launch -c /bin/sh --'" ])
> 
>         self.expect ("help -a",
> -                     substrs = [ 'run', 'process launch -c /bin/bash' ])
> +                     substrs = [ 'run', 'process launch -c /bin/sh' ])
> 
>         self.expect ("help", matching=False,
> -                     substrs = [ "'run'", 'process launch -c /bin/bash' ])
> +                     substrs = [ "'run'", 'process launch -c /bin/sh' ])
> 
>         self.expect ("run",
>                      patterns = [ "Process .* launched: .*a.out" ])
> Index: test/pexpect-2.4/doc/index.html
> ===================================================================
> --- test/pexpect-2.4/doc/index.html
> +++ test/pexpect-2.4/doc/index.html
> @@ -362,7 +362,7 @@
> For example:
> 
> <pre>
> -    child = pexpect.spawn('/bin/bash -c "ls -l | grep LOG > log_list.txt"')
> +    child = pexpect.spawn('/bin/sh -c "ls -l | grep LOG > log_list.txt"')
>     child.expect(pexpect.EOF)
> </pre>
> 
> @@ -373,7 +373,7 @@
> 
> <pre>
>     shell_cmd = 'ls -l | grep LOG > log_list.txt'
> -    child = pexpect.spawn ('/bin/bash', ['-c', shell_cmd])
> +    child = pexpect.spawn ('/bin/sh', ['-c', shell_cmd])
>     child.expect (pexpect.EOF)
> </pre>
> 
> Index: test/pexpect-2.4/doc/index.template.html
> ===================================================================
> --- test/pexpect-2.4/doc/index.template.html
> +++ test/pexpect-2.4/doc/index.template.html
> @@ -362,7 +362,7 @@
> For example:
> 
> <pre>
> -    child = pexpect.spawn('/bin/bash -c "ls -l | grep LOG > log_list.txt"')
> +    child = pexpect.spawn('/bin/sh -c "ls -l | grep LOG > log_list.txt"')
>     child.expect(pexpect.EOF)
> </pre>
> 
> @@ -373,7 +373,7 @@
> 
> <pre>
>     shell_cmd = 'ls -l | grep LOG > log_list.txt'
> -    child = pexpect.spawn ('/bin/bash', ['-c', shell_cmd])
> +    child = pexpect.spawn ('/bin/sh', ['-c', shell_cmd])
>     child.expect (pexpect.EOF)
> </pre>
> <D1576.1.patch>_______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits




More information about the lldb-commits mailing list