Problem: Switching a user through the su command does not enter the user's shell environment. Why? To solve this problem, we must be clear about the difference between using Login Shell and non-login shell.
Login Shell:Complete logon process is required for Bash. That is to say, by entering the account and password to log on to the system, the obtained
Getting started with Shell programming (version 2) (I) and getting started with shell programmingSimple example Shell program
Example 1.
#!/bin/bash#This is to show what a shell script looks likeecho "Our first example"echo # This inserts an empty line in output.echo "We are currently in the following directory."/bin/
Test switch and special parameters in Shell script, shell script1. Test Switch
The following table lists the meanings of the test commands and whether they can be used in test commands, bash, and ksh.
Switch
Test
Bash
Ksh
Definition
-A FILE
Supported
Supported
Only files exist
-B FILE
Supported
Supported
Supported
The file exists. It is a block
Linux in any case is to use the shell command, in the actual use of the shell, programming experience is very easy to get started, but a little more difficult is the shell inside the symbols, a variety of special symbols when we write the shell script if we can use the good, Often can give us a multiplier effect, to th
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 text file (shell script) to accomplish these day-to-day tasks.
Q:2 What is the default login
These eight suggestions derive from the experience and lessons learned from key writers who have been writing shell scripts for several years. In fact, began to write more than these several, and then pondered repeatedly, remove a few insignificant, finally left eight. It is no exaggeration to say that each is a carefully chosen one, although a few are commonplace.
1. Specify bash
The first line of the shell
Shell Trojan Kill is the first specifically designed for online games anti-theft number tailored to the completely free Trojan kill software, pure green, installation-free, volume only 373 KB, very lightweight, suitable for users to download the use of fast. It is produced by Jinshan's Shell Internet (Beijing) Security Technology Co., Ltd., founded in 2009, is a professional Internet Security Service and pr
The meaning of shell variable $#,$@,$0,$1,$2 in Linux is explained:
Variable Description:
$$
The shell itself PID (ProcessID)
$!
The PID of the Shell's last running background process
$?
End code of the last command to run (return value)
$-
Flag list using the SET command
$*
A list of all parameters. Output all parameters in the form of "$ $n", as in the case of "$*" with "".
$@
A list of all parameters. su
Linux Shell series (3) Shell variable, linuxshell
This article is part 3 of the Linux Shell series. For more shell tutorials, see the Linux Shell series tutorials.As an advanced script language, Shell also supports custom variable
Shell program design, shell program design experiment
1. Basic concepts of shell scripts:
(1) Shell executes shell programs, which are usually called scripts.
(2) Shell is a program that interfaces between users and systems. It al
Linux shell Escape Character metacharacter wildcard special character summary, shell escape1. linux shell wildcard (wildcard)
Wildcards are processed by shell (not by the command statements involved, but we have not found any introduction to these wildcards in shell commands
1.shell Script InterpreterBourme Shell (/usr/bin/sh or/bin//bin//usr/bin//usr/bin/ for Root (/sbin /SH)Bash is widely used in the development environment because it is easy to use and free2. First shell script#!/bin/"Hello World"#! is a contract tag that tells the system what interpreter the script needs to execute.3. There are 2 ways to run the script,(1) One is
在study(Shell)专栏中,会深刻学习到shell编程And as an OPS person, the most basic ability is to learn shell script programmingTo improve efficiency in our work!Shell Programming:Compiler: Also called interpreterThe shell provides us with another function: To facilitate our work!Programming
[From] http://blog.chinaunix.net/uid-168249-id-2860686.html
Reference: 1. system environment variables after a user logs on to the system:$ Home user's own directory$ Path: the directory to be searched during Command Execution$ TZ Time Zone$ Mailcheck the number of seconds to check whether a new letter exists$ PS1 prompt number in the Command Column$ PS2 indicates the prompt number when shell requests to re-input when the command has not been complete
Learning bash notes-debugging shell programs and learning bash shell
In shell, the simplest debugging assistant outputs the echo statement. Many echo statements can be put into the code for debugging, but it takes enough time to locate
The information to view. You may need to output a lot to find the information you want to search.1. the most basic set-o Command
Getting started with Shell programming (version 2) (medium) and getting started with shell programmingVariable test statement-test
Purpose: test whether the variables are equal, empty, and file type.
Format:
Test condition or [] # range: integer, String, file
1) integer test:
Test int1-eq int2 test whether the integer is equal
Test int1-ge int2 test whether int1> = int2
Test int1-gt int2 test whether int1>
1. Write a shell script and a shell script
I. shell and shell scripts
In linux, the text starting with #/bin/bash is interpreted by the shell interpreter.
Shell is an application that provides an interface through which users c
This article is part of the Linux Shell Series tutorial (17), more Linux shell tutorials: Linux Shell Tutorials
Through file inclusion, you can reference the contents of other files, or you can separate complex content to make the program structure clearer.
So the high-level language supports file inclusion or package references, and the
administrative files are text files that can be edited directly, most of which are in the standard directory:/etc. We write shell scripts most of the time are processing text information, and the pipeline can be used in order to be connected to the use of ... ... | ... In this way, the book has an example of a passwd file with 5 tubes attached to it. Then a script was written to convert the text into an HTML file. And then another script to help you
Login Shell: A full login process is required to go to bash. That is, by entering the account and password to log into the system, the obtained shell is called the login shellnon-login Shell: The method of obtaining the Sbash interface does not require a repeat login action. If you log in to Linux with X window, and then start the terminal with the graphical inte
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.