Operation of Kali on the 7th chapter of the Linux Bingshu directory using the shell

7.1 Creating and executing shell programs 1487.2 Variables 1497.2.1 Assigning a value to a variable 150The shell uses "=" To assign a variable, or you can change or initialize the value of a variable with an equal sign.7.2.2 Access Variable 1507.3

Shell Traversal Directory Bulk extract file name containing a string and a specific suffix

#!/bin/shmkdir  /home/zhengyk/desktop/tmp   #创建临时文件夹, used to store the extracted files #mkdir  /home/ zhengyk/desktop/local   #创建临时文件夹, used to store filter results List_alldir () {   for file in $ 1/*doif [ -d  $file  ]; thenlist_alldir 

The echo printf command for Shell programming

Both Echo and printf in the shell can be used as output, and printf is an enhanced version of EchoShow escape charactersecho \ "Abcdef\" ">>> "ABCdef"Show variablesAge=23echo "My Age is $age">>>my name is 23In the process of use, in order to avoid

Shell Programming Learning 1

1, Shell is the operating system Terminal command line(1) The shell can understand the command-line interface that the software system provides to the user, which can be said to be a way of human-computer interaction.(2) We can use the shell and the

Shell determines whether a file exists

Transferred from: http://www.cnblogs.com/sunyubo/archive/2011/10/17/2282047.html1. Shell to determine the file, whether the directory exists or has permissions2. #!/bin/sh3.4. Mypath= "/var/log/httpd/"5. myfile= "/var/log/httpd/access.log"6.7. # the-

For/while loop commands in shell programming

One, for commandIn shell programming, sometimes we need to repeat the command until a certain condition is reached, and the bash shell provides a for command that allows you to create a loop that iterates through a series of values, each of which

Shell Scripting Tips

What is a shell script, first of all it is a script, and not as a formal programming language, so to speak is that the shell script is a collection of commands.All custom scripting recommendations are placed in the/usr/local/sbin/directory, and the

[Note]shell variable basis

Variable name: Use English, Numbers and _ (underscore), the beginning can not be a number, length unlimited, strictly case-sensitiveVariable settings: variable name = variable ValueNote: No spaces on both sides of the equals signYou can enclose the

Deletion, substitution and substitution of shell variable contents

Deletion of shell variables:[Email protected]:~$ Path=${path} # #设置path和PATH相同内容 [email protected]:~$ echo $path/usr/local/sbin:/usr/local/bin:/ Usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games[email protected]:~$ echo ${path#/*sbin:} # #加上 '

I look at the first eye of the shell

I see Shell the first eye1 , script interpreter settingsfirst line of the script: #!/bin/sh[email protected] sun]# cat test.sh#!/bin/shFirst Firstrows can be split into two parts,#!and absolute paths,#!It's just a special notation,#!The interpreter

Shell script Programming-structured Command 2-for command

1. For command (1) syntax for Val in list; Do commands doneThe list parameter provides some values for the iteration, and the Val value is assigned to the value in list, knowing that the list polling ends.Commands can be one or more

Shell Learning notes-Regular expressions

what is a regular expression? Regular expressions are a grammatical rule that describes the pattern of character arrangement and matching. It is used primarily for pattern segmentation, matching, finding, and substitution of strings.two, regular

Shell script completes cluster installation of Hadoop

Although the overall implementation of the automatic installation, but there are many needs to improve the place, such as:1. The code can only be run under the root authority, otherwise it will be wrong, this need to add permission to judge;2. You

Linux Shell Script Tuning Task Scheduler

There are 2 scripts that run daily on the mission planDTS_RSYNC.SH is responsible for downloading the SQL files that are backed up onlineDTS_INPUT.SH is responsible for importing the downloaded backup files to the local MySQLNow, the problem is that

Recommend a shell custom prompt sexy solarized Bash Prompt

svn

Prompt effect: Code: # sexy solarized bash prompt, inspired by  "Extravagant Zsh Prompt "# customized for the solarized color scheme by sean o ' Neilif  tput setaf 1 &> /dev/null; then    if [[ $ (tput colors)  -ge 256 ]] 2>/dev/null; then     

Linux gets time in the shell

Get the date of the dayDate +%y-%m-%dOutput: 2011-07-28Assigns the current date to a date variabledate=$ (Date +%y%m%d)Sometimes we need to use dates before or after today, so we can use the-D parameter of dateGet Tomorrow's dateDate-d Next-day

Getting Started with Shell scripting

Writing the first shell scriptLike other languages, we use any kind of text editor, such as Nedit, Kedit, emacs, vi, etc. to write our shell program. The program must start with the following line (must be in the first line of the file):#!/bin/shThe

Shell determines whether the input variable or parameter is empty

Judging variablesRead-p "Input a word:" WordIf [!-n "$word"] ; thenecho "You had not input a word!"Elseecho "The word you are input is $word"FiJudging input parameters#!/bin/bashif [!-n "$"]; thenecho "You had not input a word!"Elseecho "The word

Shell script-L good habit

Original: Http://www.javacodegeeks.com/2013/10/shell-scripting-best-practices.html#BP11 Translation: Aven Most programming languages have a series of codes that use this language to follow good programming

Shell command to find and execute a file

svn

ReasonOften we need to find some kind of file and deal with it. For example, locate the. svn folder, and then delete it. If you do not use the shell, you can choose to manually delete, provided that there are few such files, but the SVN information

Total Pages: 541 1 .... 119 120 121 122 123 .... 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.