Transfer
1. location parametersThe parameters provided by the system are called location parameters. The value of the location parameter can be obtained using $ N. N is a number. If it is 1, it is $1. It is similar to the number in C language.In
By failing time after time, I finally master the tricks of writing Linux Shell, the most classical examples were the usage of 'if' sentence in Shell language. Here are the tips and samples:
Semantics:
If [conditions]; then
Command
Fi
1. Date
Get time and date
Date = 'date + % Y-% m-% d-% H'
Echo $ {date}
2. cron
Add a Task Scheduler
# Vi/etc/crontab
Crontab task format
* *** User task
Minute hour, day, month, week, user task
Field
Description
I encountered a problem today,
The shell script (test. Sh) is as follows:
#! /Bin/shecho "Export monitor = 1">/etc/profilesource/etc/profile
After the call (./test. Sh), execute echo $ monitor without outputting any value, but the profile has
Basic Unix shell script Test1. Which of the following code lines will print your previous working directory to the screen? CA. Echo ~B. Echo $ pwdC. Echo ~ -D. Echo *2. Which of the following symbols can be used to redirect the command output to a
Shell script compiling basics in Linux, although there are a variety of graphical interface tools, token is still a very flexible tool. Shell is not only a collection of commands, but also a very good programming language. You can use shell to
Anyone who knows makefile knows that makefile can call shell scripts. But in actual use, it is not that simple, and some ambiguity may make you crazy. If you don't believe it, let's take a look at several examples. Imagine what these examples will
Collect common skills and notes.Occasionally updated.
1. Shortcut Keys
Terminal shortcut:
CTRL + C: Stop Ctrl + Z: switch to the background Ctrl + D: cancel the current session Ctrl + W: Delete the command parameter Ctrl + u before the cursor:
By using the startup script, you can make the custom environment ready for use once and for all.These scripts run when the shell is created.The startup scripts run vary depending on whether the shell is used to log on to the shell or not.We use "Su-"
Here, I will first introduce what a shell is, then introduce my first shell program and the lessons learned from it.
I. What is shell?Before talking about my shell program, I 'd like to tell you what shell is. I believe you have heard a lot about
1 shell $! , $ ?, $, $ @
• $ N $1 the first parameter, $2 the second...• $ # The number of command-line parameters.• $0 the name of current program.• $? Last Command or function's return value.• $ The program's PID.• $! Last program's PID.• $ @
I have been busy with projects recently and encountered a very tangled problem in the process. Other shell scripts can be called only after the shell script training database is executed. Here we will summarize and share it with you.
The script is
Preface
Quick edit shell command line
The most common cause is that Nux beginners say that the most annoying thing is Linux/Unix command lines. If you are an impatient person, you can first try the comprehensive exercises at the end of the article
Power shell provides the definition function for user variables.
Variables do not need to be declared first (of course, they are in uniformity. For some global variables, we recommend that you declare them first and assign values). The variable
This article is the Second Reading Note of Flow Control in Chapter 5 of Learning the bash Shell 3rd Edition, but we will not limit it to this. Flow control is a common part of any programming language and includes bash. Here, we will continue to
Document directory
Syntax of the read command:
Process Input
Original article: Linux Shell scripting tutorial V2.0Syntax of the read command:
read -p "Prompt" variable1 variable2 variableN
-P "prompt": displays the prompt information
In Linux, It is very troublesome to use ruijie. After installing myxrgsu, you must enter your account and password every time you use it. This process is too cumbersome. So I want to find a way to automatically enter the password and other
Linux ShellLittle-known secrets in command lines
/* Pass the test in linux */One day, you wrote a very long command.$ Echo ooooooooooooooooooooooooooooooooooooooooooooYou suddenly don't want to execute it, and you want to delete the entire command,
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