First, the problems encountered:
Today, a friend asked me, said in the CentOS write good script, in Ubuntu can not normal use, at that time did not care, thought is the authority is not configured well, later looked under, found that Ubuntu and CentOS default shell is different, if recorded, to avoid forgetting later:
1, Ubuntu default shell is connected to dash, while we usually write shell script used when bash. 2. Bash and dash are incompatible in some ways. So executing the same script, the results are different and may be used./*sh can be executed, and SH *.sh error. 3, Ubuntu uses dash because of its small size, high compatibility, but for the people who often use CentOS, this is more tragic, some bash executable footsteps in the dash can not be executed, script portability is not guaranteed.
Second, the solution:
1, check whether the script has X permission, if there is, then proceed to the second step 2, sudo dpkg-reconfigure dash, and then appear in the interface select NO
This article is from the "Frozen vs watermelon" blog, so be sure to keep this source http://molewan.blog.51cto.com/287340/1947107
Ubuntu Script execution Error checking idea