In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Recently, when I used Bash on Ubuntu on Windows to debug the shell script, I found that I would report an error when using source in the script. After checking the Internet, I realized that it was not bash that was used in Ubuntu, but the optimized dash was used. There is no source in dash, but there is only source in bash. This is a bit troublesome. Usually, when writing scripts, I sometimes call the function of the system and some custom function. It is really a bit inconvenient without source. At this point, you can use dpkg-reconfigure to modify the configuration of dash. You can use the following methods to verify the shell environment used in your system:
Root@localhost:~# ls-l $(which sh) lrwxrwxrwx 1 root root 4 September 9 22:09 / bin/sh-> dash
Modify:
Root@localhost:~# dpkg-reconfigure dash
Then choose No. If you look at the shell environment used in the system at this time, it will be changed to bash.
Root@localhost:~# ls-l $(which sh) lrwxrwxrwx 1 root root 4 September 9 22:09 / bin/sh-> bash
You can use source at this time. Of course, if you do not want to change the default settings in the system, you can also write scripts using the correctly defined shell environment, or simply use the env command in the system to let the system find the correct shell environment:
#! / bin/env bash
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.