Shell (13) parameter substitution

Shell parameter substitution xargs. Parameters that generate the command1. Cut-d ': '-f 1/etc/passwd | Head-n 3 | Xargs finger  2. Ask the user before executingCut-d ': '-f 1/etc/passwd | Head-n 3 | Xargs-p FingerIf you press ENTER directly, exit  3.

III. shell variable types and operators

first, the application of shell variables1. Types of Shell variables·User-defined variables: defined, modified, and used by the user    ·Pre-defined variables: Bash predefined special variables that cannot be modified directly·Positional variables:

Shell Learning Note 1

Knowledge point 1, modify the color of the outputEcho-e "\e[1;31m This is red text \e[0m"Where \e[1;31m indicates that the output is displayed in red, the \E[0M logo resets the color, and 31 can be replaced by a different color value, which is used

Shell Basics Learning (v) Test command

1. Numerical test Parameters Description -eq Equals is True -gt is greater than true -lt is less than true -nq Not equal to True -ge

One day a shell

Day01Write a script to do the following: Enter a number, and then run the corresponding command. The display command is as follows: *cmd meau** 1---date 2--ls 3--who 4--pwdWhen you enter 1 o'clock, you run the date, enter 2 o'clock to run LS, and so

Shell script to install JDK under Redhat

It's annoying to unload the system following the OPENJDK and then install the orcle jdk every time, soWriting a script execution is a hassle, just put the following bash script and the one you're downloadingThe jdk-7u79-linux-x64.tar.gz package can

Conditional judgment in Linux Shell corner

1. Condition Judgment:If use:if condition; Then commands; fiIf else uses:if condition; Then commands; Else if Then commands; Else commands; fiDescription&&| | action; # If condition is false, the action is executed. && is the logic and operator, |

Ant invoke Shell command (Ubuntu)

Call makefile in Ant and use the make command in the shellXML version= "1.0" encoding= "Utf-8"?> Projectname= "Dy_cike_init"Basedir="."> Targetname= "HAIT_CPR"Description=""> execexecutable= "/bin/sh"> Arg Line= "-C

Linux Learning Note (iii)-shell command mechanism

Toggle command line: CTRL+ALT+F1-F6 Switch to graphical interface: CTRL+ALT+F7 Ls-list (dir under Win)White: Normal fileBlue: Catalog FileGreen: Executable fileTo perform the steps: Input ls In the relevant directory go to the

Linux Shell several special symbols Command &, &&, | |

& placed after the startup parameter to set this process as a background process By default, the process is the foreground process, then the shell is occupied, we can not do other operations, for those who do not interact with the process, many

Shell Regular Expression

Classification of regular expressions Basic Regular Expressions (basic Regular expression also known as basic RegEx abbreviation Bres) Extended Regular expression (Extended Regular expression also known as Extended RegEx abbreviation

SHELL variables for the collation of notes

Types of variables:1. Custom variablesDefine variables: Variable name = variable value variable name must start with a letter or underscore, case sensitive url1=test.3glong.comReference variable: $ variable name or ${variable name}View variables:

Shell executes three ways

View current ShellEcho $SHELLgrep root/etc/passwdBeginning:#!/bin/bash#!/bin/shls-l/bin/shShell typesCat/etc/shells/etc/init.d/nfs/etc/init.d/crond/etc/init.d/rc.d/rc.sysinitBash--versionThe shell performs three ways:1,sh T.s or Shell

Print out 1,11,21,31,41 ... The shell script

Print out 1,11,21,31,41 ... The shell scriptmethod One:#!/bin/Bash for((i=1;i the; i=i+Ten)); Doecho $i #cat-n/etc/services | Sed-n"${i}p"#sed-N"${i}p"/etc/ServicesdoneOperation process, first cycle:1;1echo "1"Second cycle:1=1+10=11;11echo "11"Third

Linux08--shell Programming the shell script

First shell script--helloworld[Email protected] ~]# VI sh01.sh#!/bin/bash #! Indicates which shell# this is my first shell script #注释部分echo-E "Hello world!" Exit 0[[email protected]~]# SH sh01.sh # execute SH file Hello world! using bash or SH

The main differences between [[]] and [] in the shell

[] is actually shorthand for the test command in bash. That is, all [expr] equals test exprFor the test command, use-eq to make a numeric comparison, and when you pass in the string, you get an error.[[expr]] is a real conditional judgment statement

Linux timed execution shell

First step: Install crontab, command yum-y install Vixie-cronExtension: Service Crond start//Startup servicesService Crond stop//Shutdown servicesService Crond restart//Restart servicesService Crond Reload//Reload ConfigurationService Crond

"Original" Java program calls remote shell script

The purpose of this program is to execute shell scripts on the remote machine."Environment Parameters"Remote machine ip:192.168.234.123User name: RootPassword: rootPath to shell script:/home/ifilegentool/bakprovisionandoccurentrance.sh"Concrete

Shell (10) sort

1. SortA. Sorting strings by default  B. With-r option: Reverse sort  C. Specify the option data field separator with-T, and the-K option specifies the data field to compare  D. Use the-N option to specify "pure digit sorting". As can be seen in the

First day on cnblogs, broken shell Date ~ ~

Suddenly want to find a place to write a little article, and think of this old account, not because of the long-term silence was deleted is very touched ... All right, let's just commemorate this. First day.I suddenly wanna write something and

Total Pages: 541 1 .... 426 427 428 429 430 .... 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.