In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what is the function of Linux enable command". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Enable starts or disables shell built-in commands
Summary enable [- a] [- dnps] [- f filename] [name …]
The main purpose is to disable one or more built-in commands.
Enable one or more built-in commands.
Directly invoke an external command with the same name as the disabled built-in command and found under the $PATH path.
Print all built-in commands, whether disabled or not.
Print built-in commands that are enabled.
Print built-in commands that are disabled.
Print posix standard built-in commands that are enabled.
Print posix standard built-in commands that are disabled.
Print posix standard built-in commands, whether disabled or not.
Load built-in commands from the dynamic library.
Removes built-in commands loaded from the dynamic library.
Option-a prints all built-in commands, whether disabled or not. -d removes built-in commands loaded from the dynamic library. -n disable built-in commands or display disabled built-in commands. -p prints in a reusable format. -s displays only posix standard built-in commands that are in the startup state. -f load built-in commands in the dynamic library. -ns prints posix standard built-in commands that are disabled. -as prints posix standard built-in commands, whether disabled or not. Parameter filename: dynamic library file name.
Name (optional): built-in commands, which can be multiple.
The return value enable returns success unless name is not a built-in command or an error occurs.
Example (the following is limited to the section that no longer lists the return values) # posix special builtin # assumes that no built-in commands are disabled # disable two posix standard built-in commands enable-n set source # print the disabled posix standard built-in commands enable-ns # print posix standard built-in commands, whether disabled or not Enable-as # Printing the posix standard built-in command enable-s # assumes that no built-in commands are disabled # disable one or more built-in commands enable-n echo pwd # print all built-in commands, whether disabled or not Enable-a # print enabled built-in commands enable # print disabled built-in commands enable-n # enable one or more built-in commands enable pwdQ&AQ: what about the demo of-fmai?
A: to explain,-f and-d are limited to personal ability and do not find a suitable example. If you have a better example, you are welcome to mention pr;. I have verified that there seems to be no difference in the use of the-p option. What is the difference between enable-p | cat-An and enable | cat-A? (note: cat-An is used to display invisible characters)
Q: can I disable enable itself? Can you disable or enable built-in commands after that?
A: yes; no.
Note that when the linux shell command is executed, shell always looks for the command in its own shell builtin first, and executes it if it is found; if it cannot be found, it looks for the command to be executed in turn from the path specified by the environment variable $PATH. There seems to be no way to write your own commands instead of shell builtin commands. Fortunately, we can do it with the enable command.
When the built-in command echo is not disabled, you can only write / usr/bin/echo if you want to call the external command echo
When we disable echo, the priority order is as follows:
Function > external command
If the environment in which the command is executed does not have an echo function, then the echo called is an external command.
This command is a bash built-in command. For help, please see the help command.
This is the end of the content of "what is the function of the Linux enable command". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.