1 #!/bin/sh2 3 #The first Linux script, too many do not understand the place, just according to the online example divert, can run normally4 #Operating Environment CentOS 7.0 version5 6 #The first line specifies the path to the program, and the line that begins with the # number is the comment line7 8 #edit this document in any text editor. Default is Gedit9 #save in the document file, assuming this file is named Test.shTen #Right-click the property to make it executable, or right-click the menu terminal chmod +x test.sh One #because the following command creates a folder that requires higher permissions, execute the command Su-can be manipulated under sudo permissions A #you can also directly, right-click-Terminal command: sudo./test.sh to run - - #declaring variables, using the $ symbol before thehello="automatically upgrade Python to the new version, note the revision number to be manually modified" - Echo $hello - -Ver='3.4.3' +Pathname="Python-${ver}" -Filename="${pathname}.tgz" + A #Delete the original file, MO has the file will prompt, but does not affect the running atRm"${filename}" - - #Download python3.4.3 installation package - #This type of variable replaces the single quotation mark, otherwise the variable is not recognized -Wget"http://www.python.org/ftp/python/${ver}/$Filename" - in #Unpacking the installation package -Tar-zxvf"${filename}" to + #go to unzip directory -Cd"${pathname}" the * #Create the installation directory $Mkdir"/usr/local/${pathname}"Panax Notoginseng - #Compiling the installation the./configure--prefix="/usr/local/${pathname}" + A #Execution theMake && make install
CentOS 7.0 installs Python3. X Script