Penguin
Diff: ShellBuiltinNotes
EditPageHistoryDiffInfoLikePages

Differences between version 2 and previous revision of ShellBuiltinNotes.

Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History

Newer page: version 2 Last edited on Thursday, August 16, 2007 8:03:15 pm by BenStaz Revert
Older page: version 1 Last edited on Thursday, August 16, 2007 7:17:33 pm by BenStaz Revert
@@ -4,10 +4,19 @@
  
 *type <command_name> 
  
 <verbatim> 
-staz@tokra:~/test $ type cd 
+$ type cd 
 cd is a shell builtin 
  
-staz@tokra:~/test $ type mkdir 
+$ type mkdir 
 mkdir is /bin/mkdir 
 </verbatim> 
+  
+!But I want to use an external program rather than a shell-builtin.  
+  
+If a command specified to the shell contains a slash ''/'', the shell will not execute a builtin command. Thus, while specifying ''echo'' causes a builtin command to be executed under shells that support the builtin echo command, specifying ''/bin/echo'' does not.  
+  
+!Why can I not use ''sudo <shell_builtin>'' ?  
+  
+A shell builtin is not an executable file so sudo does not know about it.  
+You will need to use the command ''sudo -s'' to get a new shell with root privileges or alternatively you can do ''sudo bash -c "<shell_builtin>" [args]''.