Pages

Tuesday, July 13, 2021

builtin(command) bash

builtin command is useful to define a shell function with the same name as a shell builtin, retaining the functionality of the builtin within the function.


 The main use of this command is to define a shell function having the same name as the shell builtin by keeping the functionality of the builtin within the function.


Syntax:


builtin [shell-builtin [arg ..]]

Example: Here, we are creating a function to replace the ‘cd’ command. When you will use cd() function it will change the directory to the desktop directly.

No comments:

Post a Comment