Bash and dash in Ubuntu Shell

By default, the Ubuntu shell is installed with Dash instead of bash.Run the following command to view the sh details and confirm the corresponding ShellProgramWhich is:$ LS-Al/bin/sh Dash is lighter and faster than bash. Bash is more commonly

Shell variables:

Shell variables:(1) The variable and the variable content are connected with the equal sign "=;(2) The equal signs cannot be directly followed by space characters;(3) The variable name can only contain English letters and numbers, but cannot start

Install the bumblebee dual-graphics card driver shell script under fedora 19

Based on the tutorials on the official website, the test is available. Note that you must use the root permission to run the task. #!/bin/bash# This script run the init command for opotimus pc;# Fedora 19;# run as the rootecho 'run as the root'yum

Automatic Interaction with Linux shell scripts

Method 1: (take the copy and generate key after OpenSSH compilation as an example) #! /Bin/bashdir_path = $ home/sshdfilecp sshd $ dir_path/sbincp scp sftp ssh-add ssh-Agent ssh-keygen ssh-keyscan $ dir_path/bincp sftp-server ssh-keysign $ dir_path/

Implement a simple Shell

# Include # include # include # include # include # define maxargs 20 # define arglen 100 main () { char * Arglist [maxargs + 1]; int numargs; char argbuf [arglen]; char * makestring (); numargs = 0; while (numargs { printf ("Arg [

Chapter 5 Study Notes of Linux Command Line and shell script Programming

Chapter 2: using structured commands Use the if-then statement if commandthen commandsfi If the exit status code of the command after if is 0, execute then. Another Form if command; then commandsfi   If-then-else statement if commandthen

Sorting Algorithm-shell sorting

Shell sorting is a form of change in insert sorting. Because insert sorting compares each element and compares the current element with all the previous elements, in the worst case. Therefore, DL. shell proposed shell sorting in 1959, that is,

Common Linux Shell shortcuts

  Some terminal shortcut keys: CTRL + F Forward one character CTRL + B Move one character behind CTRL + E Move to end of line CTRL + L Clear Screen CTRL + d Delete current

Shell script exercises and Instances

Shell scripts are used to record some exercise questions and shell scripts I have actually written here for learning and querying. User input y or y ends While Mode#! /Bin/bashRead-P "input you choice:" CWhile ["$ C "! = "Y"-a "$ C "! =

Shell setting noglob variable

14 noglob variable Set noglob to stop the wildcard function, that is, the image symbol *? [] {}~ And so on. All of the special functions they represent will be ineffective. It only represents general characters. The following is an example:

Shell script Learning (1): Shell variables and some common commands

Shell script Learning (1): Shell variables and some common commands Shell allows you to create variables to store data, but does not support basic data type variables (such as int, float .....), shell interprets any value assigned to a

Linux Shell -- case statement

The case statementthe case statement is good alternative to multilevel if-then-else-fi statement. It enable you to match several Values against one variable. Its easier to read and write. Syntax: case $variable-name in

Shell script batch modifies a string in the file (without correction or modifying the ELF File)

#! /Bin/sh #*********************************** **************************************** * ** # Change "/bin/sh" to "/system/bin/sh "##****************** **************************************** * ******************/if [$ uid! = 0] Then ECHO "failed:

Summary of several parentheses in the shell script (parentheses/braces/curly braces)

From: http://www.cnblogs.com/hanyan225/archive/2011/10/06/2199652.html There is no doubt about the strength of shell, which makes it easier for us to confuse us. For example, I have always thought that I am smart and cannot tell you clearly.In Shell,

Shell programming-Day 2

Ls-l dir1 | WC-L. 1. While condition; do done // () [] Test2. Until is the same as above. It is executed only when the condition is not true.3. /Dev/null: Unix black hole. Used to clear the file CAT/dev/null> XX find-name a.txt 2>/dev/null4. Note:

Unix shell comparison

Unix shell programming Summary of some conditions -B file: if the file exists and is a special block file, it is true.-C file: if the file exists and is a special character file, it is true.-D file: if the file exists and is a directory, it is true.-

Shell tracking options

If the command "Set-X" is added to the script file, each command executed after the set command and any parameters added to the command line (including the values of variables and variables) will be displayed. A plus sign (+) is added before each

Example of using the while loop in Shell

#! /Bin/sh # Filename: 2.sh B = 9 E = 15 Tmpb = $ B While [$ tmpb-Le $ E] Do Echo $ tmpb # Tmpb = 'expr $ tmpb + 1' // OK Tmpb = $ (expr $ tmpb + 1) Done After the script is executed, the output result is: 9101112131415   Note: The

How to judge whether a variable is empty in shell?

To determine whether the variables in a script are empty, I wrote a shell script like this: #! /Bin/sh # Filename: Test. Sh Para1 = If [! -N $ para1]; then Echo "is null" Else Echo "not null" Fi Then run the Script: test. sh uses

Special characters in Linux Shell

Special characters in Linux Shell 1. braces: Usage 1: wildcard Extension Eg: ls my _ {finger, toe} s This command is equivalent to a combination of the following commands: Ls my_fingers my_toes For example: mkdir {usera, userb, userc}-{home, bin,

Total Pages: 541 1 .... 499 500 501 502 503 .... 541 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.