builtin

Run a shell builtin, passing it args, and return its exit status.

Syntax
      builtin [shell-builtin [args]]

This is useful when defining a shell function with the same name as a shell builtin, retaining the functionality of the builtin within the function.

The commands marked • in the main A-Z list are bash built-ins:
alias, bind, break, builtin, caller, command, continue, declare, echo, enable, help, jobs, let, local, logout, mapfile, printf, read, readarray, source, suspend, trap, type, ulimit, unalias, wait.

The return status is non-zero if shell-builtin is not a shell builtin command.

This is a BASH shell builtin, to display your local syntax from the bash prompt type: help [b]uiltin

Example

A function to replace 'cd' that writes the hostname and current directory to an xterm title bar:

cd()
   {
      builtin cd "$@" && xtitle "$HOST: $PWD"
   }

"More people are killed every year by pigs than by sharks, which shows just how good we are at evaluating risks” ~ Bruce Schneier

Related Linux commands

chroot - Run a command with a different root directory.
cron - Daemon to execute scheduled commands.
exec - Execute a command.
if - Conditionally perform a command.
nohup - Run a command immune to hangups.
su - Run a command with substitute user and group id.
shopt - Shell Options.
.source - Run commands from a file.
type - Describe a command.
watch - Execute/display a program periodically.
Equivalent Windows command: CALL - Call one batch program from another.


 
Copyright © 1999-2024 SS64.com
Some rights reserved