Type of variable in bash
Local variable: Valid only for the current shell and not for its child shell
Variable assignment: Name=value
Name= $user
Name= ' command ', name=$ (command): "The Meaning of" and $ () is different.
The following figure
What is the Q:1 shell script and is it required?
A: A shell script is a text file that contains one or more commands. As a system administrator, we often need to use multiple commands to complete a task, and we can add all of these commands in a
Hosts file
Hosts--the static table lookup for host name (host name query for static tables).
The Hosts file is the last file in the Linux system responsible for fast resolution of IP addresses and domain names, saved in ASCII format under
Linux is the future of the operating system, most of the current domestic operating system, and even Android system is inseparable from the relationship between Linux. Among them, ftp as a means of sharing has been a long time, we today to see how
I am a new Linux user. Now I need to clean up a download directory of files, in fact, I just want to delete from the ~/download/folder in addition to the following format files so other files:
1.*.iso-All documents in ISO format.2.*.zip-All files
"Conditional judgment"1. Judging by file type-B file to determine if the file exists and is a block device file (is a block device file is true)-c file to determine if the file exists and is a character device file (the character device file is true)
1. Monitor CPU information with Vmstat tools.Vmstat is a Linux system monitoring tool that uses the Vmstat command to get information about processes, memory, memory paging, blocking IO, traps, and CPU activity.R: The number of processes in the
(i) SEDSed is a streamlined, non-interactive, streaming editor that enters edit commands and specifies file names on the command line. Then look at the output on the screen.The progressive reading of the file contents is stored in a temporary buffer
The knowledge points in this article are related to conditional testing of shell scripts.Often in shell scripts we need to do a variety of conditional judgments, such as testing whether a file exists, whether it is a file or directory, whetherhas
This article focuses on the core foundations of shell variables.1. What are the variables?What is a variable? Many people may not understand, simply put, a variable is a fixed string (or possibly a combination of characters, numbers, etc.) instead
Under Ubuntu I wrote a shell script with bash to grammar (exactly the script on the computer), under Ubuntu, with SH test.sh to run, but there are unexpected results, such as ECHO-E "\ntest\n" to the execution is different, Run directly with the SH
Reference: Linux commands, editor and Shell programming, advanced Programming for UNIX environmentsBoth exec and source belong to the Bash internal command (builtins commands), where you can view all the internal command information by entering man
Original link: http://blog.chinaunix.net/uid-22548820-id-3181798.html
Fork (/directory/script.sh): If the shell contains execution commands, the subcommands do not affect the parent's commands. When the subcommand executes and then executes
Today, when I write a shell script, I find that debugging will make a mistake.[Email protected] autoawrrpt]$. a.sh dirname: Invalid option--B Please try to perform "dirname--help" for more information. BaseName: Invalid option--B Please try
From the programmer's point of view, the shell itself is a program written in C language, from the user's point of view, the shell is the user and the Linux operating system communication Bridge. The user can either enter command execution or use
Variable substitution$variable is a shorthand for ${variable}hello= "A B C D"Echo $hello # A B C Decho "$hello" # A B C DThe quotation mark preserves the whitespace inside the variable1 echo "$uninitialized" # (blank line)2 Let "uninitialized + = 5"
The quickest way to learn to write script is to watch someone else's script file. However, although this method is practical, it is often "less effective" or even halfway to the shell's basic cognitive deficit. The first problem is that you don't
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.