In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
What the editor shares with you today is the use of the linux system's own program / bin/true and / bin/false. I believe most people don't know much about it. In order to make you understand better, the editor summarizes the following content for you. Without saying much, let's move on.
/ bin/true returns 0
/ bin/false returns 1 (or a non-zero value)
Commonly used for self-writing scripts to set $according to their own logic? Example of the value of / bin/trueecho $? # result 0/bin/falseecho $? # use instructions for result 1
# two function, which refer to / etc/init.d/functions and use the action function
#
[server]-[root@arrow ~] $action "test" / bin/true; echo $? test [OK] 0 [server]-[root@arrow ~] $action "test" / bin/false; echo $? test [OK] attention to the following actual echo $? The returned 0 is the result of action # the two items above return the result of true false [server]-[root@arrow ~] $action "test" Echo $? test [OK] 0Murray- -Start_Nginx () {if [- f $pidfile] Then echo "Nginx is running" else / usr/local/nginx/sbin/nginx & > / dev/null action "Nginx is Started" / bin/truefi} # Stop_Nginx () {if [- f $pidfile] Then / usr/local/nginx/sbin/nginx-s stop & > / dev/null action "Nginx is Stopped" / bin/trueelse action "Nginx is Stopped" / bin/falsefi}
The above are the details of the use of the linux system's own programs / bin/true and / bin/false. Have you gained anything after reading it? If you want to know more about it, you are welcome to follow the industry information!
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.