What does running “builtin” do? [duplicate]
up vote
1
down vote
favorite
This question already has an answer here:
How do I get help for “echo” or other bash commands?
4 answers
Simple question, really...
Builtin?
What happens when you run: builtin
?
The return type from echo $?
is 0
.
Which means that the command has most likely run successfully.
So, what does running builtin
accomplish?
bash
marked as duplicate by pzkpfw, George Udosen, Marcel Stimberg, wjandrea, N0rbert Nov 20 at 19:57
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
1
down vote
favorite
This question already has an answer here:
How do I get help for “echo” or other bash commands?
4 answers
Simple question, really...
Builtin?
What happens when you run: builtin
?
The return type from echo $?
is 0
.
Which means that the command has most likely run successfully.
So, what does running builtin
accomplish?
bash
marked as duplicate by pzkpfw, George Udosen, Marcel Stimberg, wjandrea, N0rbert Nov 20 at 19:57
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
How can I get help on terminal commands?
– dessert
Nov 19 at 21:17
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
This question already has an answer here:
How do I get help for “echo” or other bash commands?
4 answers
Simple question, really...
Builtin?
What happens when you run: builtin
?
The return type from echo $?
is 0
.
Which means that the command has most likely run successfully.
So, what does running builtin
accomplish?
bash
This question already has an answer here:
How do I get help for “echo” or other bash commands?
4 answers
Simple question, really...
Builtin?
What happens when you run: builtin
?
The return type from echo $?
is 0
.
Which means that the command has most likely run successfully.
So, what does running builtin
accomplish?
This question already has an answer here:
How do I get help for “echo” or other bash commands?
4 answers
bash
bash
asked Nov 19 at 21:10
NerdOfCode
1,062323
1,062323
marked as duplicate by pzkpfw, George Udosen, Marcel Stimberg, wjandrea, N0rbert Nov 20 at 19:57
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by pzkpfw, George Udosen, Marcel Stimberg, wjandrea, N0rbert Nov 20 at 19:57
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
How can I get help on terminal commands?
– dessert
Nov 19 at 21:17
add a comment |
How can I get help on terminal commands?
– dessert
Nov 19 at 21:17
How can I get help on terminal commands?
– dessert
Nov 19 at 21:17
How can I get help on terminal commands?
– dessert
Nov 19 at 21:17
add a comment |
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
$ type echo
echo is a shell builtin
$ function echo(){ builtin echo "'$1'"; }
$ echo hi
'hi'
help builtin
builtin: builtin [shell-builtin [arg ...]]
Execute shell builtins.
Execute SHELL-BUILTIN with arguments ARGs without performing command
lookup. This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
Exit Status:
Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is
not a shell builtin.
add a comment |
up vote
2
down vote
From help -m builtin
:
NAME
builtin - Execute shell builtins.
SYNOPSIS
builtin [shell-builtin [arg ...]]
DESCRIPTION
Execute shell builtins.
Execute SHELL-BUILTIN with arguments ARGs without performing command
lookup. This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
Example usage:
cd (){
builtin cd "$@"
pwd
}
This cd
's, then prints the new working directory (like in IPython). If you forget the builtin
part, it will keep calling itself in an infinite loop.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
$ type echo
echo is a shell builtin
$ function echo(){ builtin echo "'$1'"; }
$ echo hi
'hi'
help builtin
builtin: builtin [shell-builtin [arg ...]]
Execute shell builtins.
Execute SHELL-BUILTIN with arguments ARGs without performing command
lookup. This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
Exit Status:
Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is
not a shell builtin.
add a comment |
up vote
5
down vote
accepted
This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
$ type echo
echo is a shell builtin
$ function echo(){ builtin echo "'$1'"; }
$ echo hi
'hi'
help builtin
builtin: builtin [shell-builtin [arg ...]]
Execute shell builtins.
Execute SHELL-BUILTIN with arguments ARGs without performing command
lookup. This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
Exit Status:
Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is
not a shell builtin.
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
$ type echo
echo is a shell builtin
$ function echo(){ builtin echo "'$1'"; }
$ echo hi
'hi'
help builtin
builtin: builtin [shell-builtin [arg ...]]
Execute shell builtins.
Execute SHELL-BUILTIN with arguments ARGs without performing command
lookup. This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
Exit Status:
Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is
not a shell builtin.
This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
$ type echo
echo is a shell builtin
$ function echo(){ builtin echo "'$1'"; }
$ echo hi
'hi'
help builtin
builtin: builtin [shell-builtin [arg ...]]
Execute shell builtins.
Execute SHELL-BUILTIN with arguments ARGs without performing command
lookup. This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
Exit Status:
Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is
not a shell builtin.
edited Nov 19 at 21:18
answered Nov 19 at 21:14
Ravexina
30.6k1478106
30.6k1478106
add a comment |
add a comment |
up vote
2
down vote
From help -m builtin
:
NAME
builtin - Execute shell builtins.
SYNOPSIS
builtin [shell-builtin [arg ...]]
DESCRIPTION
Execute shell builtins.
Execute SHELL-BUILTIN with arguments ARGs without performing command
lookup. This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
Example usage:
cd (){
builtin cd "$@"
pwd
}
This cd
's, then prints the new working directory (like in IPython). If you forget the builtin
part, it will keep calling itself in an infinite loop.
add a comment |
up vote
2
down vote
From help -m builtin
:
NAME
builtin - Execute shell builtins.
SYNOPSIS
builtin [shell-builtin [arg ...]]
DESCRIPTION
Execute shell builtins.
Execute SHELL-BUILTIN with arguments ARGs without performing command
lookup. This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
Example usage:
cd (){
builtin cd "$@"
pwd
}
This cd
's, then prints the new working directory (like in IPython). If you forget the builtin
part, it will keep calling itself in an infinite loop.
add a comment |
up vote
2
down vote
up vote
2
down vote
From help -m builtin
:
NAME
builtin - Execute shell builtins.
SYNOPSIS
builtin [shell-builtin [arg ...]]
DESCRIPTION
Execute shell builtins.
Execute SHELL-BUILTIN with arguments ARGs without performing command
lookup. This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
Example usage:
cd (){
builtin cd "$@"
pwd
}
This cd
's, then prints the new working directory (like in IPython). If you forget the builtin
part, it will keep calling itself in an infinite loop.
From help -m builtin
:
NAME
builtin - Execute shell builtins.
SYNOPSIS
builtin [shell-builtin [arg ...]]
DESCRIPTION
Execute shell builtins.
Execute SHELL-BUILTIN with arguments ARGs without performing command
lookup. This is useful when you wish to reimplement a shell builtin
as a shell function, but need to execute the builtin within the function.
Example usage:
cd (){
builtin cd "$@"
pwd
}
This cd
's, then prints the new working directory (like in IPython). If you forget the builtin
part, it will keep calling itself in an infinite loop.
edited Nov 20 at 20:04
answered Nov 19 at 21:14
wjandrea
7,92742258
7,92742258
add a comment |
add a comment |
How can I get help on terminal commands?
– dessert
Nov 19 at 21:17