In the shell execution of Ubuntu, the user root is different from the common user. Using vi/etc/passwd, we can see that the root location is/bin/bash in the last line of the user, that is, the location where shell execution is defined, while other users are/bin/sh. therefore, the bashtest should be used when the root user executes scipt In Ubuntu. sh (note that in linux, there is no file suffix added only to identify special files. Whether the file can run the master
In the shell execution of Ubuntu, the user root is different from the common user. Using vi/etc/passwd, we can see that the root location is/bin/bash in the last line of the user, that is, the location where shell execution is defined, while other users are/bin/sh.
Therefore, in Ubuntu, it should be bash test. sh when the root node executes scipt (note that there is no file extension in linux, and it is only used to identify special files. Whether the file can be executed depends on whether x in the file attribute is opened North) rather than sh test. sh.
#! /Bin/bash
Declare-I number2 = 10 + 100 + 1000
Echo "Your result is $ number1"
...:~ $ Sh test03-declare.sh
Test03-declare.sh: 5: declare: not found
...:~ $ Bash test03-declare.sh
...:~ $ Your result is 1110