The CentOS shell command line only shows that the-bash-4.1# does not show the user and path resolution

 today accidentally hit the home directory Delete command, although finally for a variety of reasons did not delete, but the home directory, many files and directories are deleted, and the command line does not display the current user and path.

Linux Shell Script Raiders (1.5)

1.5 using the shell for mathematical operationsIn any programming language, arithmetic operations are essential, and the shell is no exception.1.5.1 arithmetic operations using Let, (()), and [] You can use the normal variable assignment

Linux Shell Script Raiders (1.3)

1.3 Playing variables and environment variablesvariables are an essential part of any programming language and are used to store variables of various types. Scripting languages are mostly weak type languages (dynamic languages), meaning that when

function return value in shell

1. PrefaceAlmost half a year did not write a blog, wasted a long time, work in the chores too much, their own more and more lazy. In order to spur their own growth, or to insist on writing a blog, record their growth.2. Shell Function

Getting Started with Shell scripting

1. Check the current system who is logged in: Who2. Count the logged-in users of the current system: who | Wc-l (L-->line,w-->word,c-->character)3. Small shell script development cycle: $cat > Nusere new file, using Cat copy terminal inputW.H.O. |

While and unil process control in the shell

While loop:Format OneWhile condition;DoStatementDoneFormat Two dead loopsWhile TrueDoStatementDoneFormat three dead LoopsWhile:DoStatementDoneFormat Four dead LoopsWhile [1]DoStatementDoneFormat Five Dead LoopsWhile [0]DoStatementDone****************

Conditional testing in the shell

Test command usage:1) Judgment expressionif test (expression is true)if test! An expression is falsetest expression 1–a expression 22 expressions are truetest expression 1–o expression 22 expressions have a true2) Judging the stringtest–n String

2015.4.8 Shell Basics

1. Shell FeaturesOrder history!! !$!n! characterTab key to complete file path or commandAlias a= "B" Unalias AWildcard * Matches 0 or more characters? Match one characterInput/Output redirection >,>>,,2>>Pipe characterJob Control CTRL + Z jobs FG BG2

Determine if a string is empty inside the shell

determine if a string is empty inside the shell Category: Linux shell2011-12-28 23:18 15371 people read reviews (0) favorite report ShellThere are several main ways to do this:echo "$str" |awk ' {print length ($)} 'Expr Length "$str"echo "$str"

Conditional test statements in the shell

The shell has conditional test statements, which are usually done using the test command or the [] command, which is the basis of the conditional Judgment statement If~then statement, especially the [] command. Let's explain some of the conditional

A binary conversion in the shell

The default value in the shell is decimal, so how are binary, octal, and hexadecimal represented?Method 1: Use the prefix.0 begins with octal, and 0x starts with hexadecimal.As follows:#-----------------------------/chapter4/ex4-35.sh----------------

Several ways the shell script executes

There are several ways to execute the shell script1, relative path mode, you need to first CD to the script path[[email protected] tmp]# Cd/tmp[[email protected] tmp]#./ceshi.sh Script Execution succeeded2. Absolute path mode[[email protected] tmp]#/

Clustershell Bulk execution of shell commands

Installing ClustershellInstall from https://github.com/cea-hpc/clustershell/downloads below source or binary package. The following is an example of CentOS6.6 using RPM installation: wget

Special characters for Shell scripts

1. #注释作用, #! Except in addition, in the parameter replacement echo ${path#*:} here does not represent the comment, the numeral conversion, does not represent the comment echo $ ((2#101011)) 2. Command line delimiter, you can write multiple commands

The maximum number of arguments the shell supports

This article turns from: http://www.jb51.net/article/56548.htm This article mainly describes how many parameters the shell supports? This article is a test article on how many parameters a shell can enter, and the friend you need can refer to the

Bash-shell-scripts Advanced Script Configuration IP address

[[email protected] shell]# cat mod_ip_hostname.sh #!/bin/bash#auto modify  Ip and hostname#by colin on 2015-05-07ip_config= '/etc/sysconfig/network-scripts/ Ifcfg-eth0 ' hostname_config= '/etc/sysconfig/network ' hosts_config= '/etc/hosts '

Shell Step by Step (3)--stdin & IF

4. Input and output#! /bin/bash# Read users input and then get his nameread"Please input your first name: " firstNameread"Please input your last name: " lastNameecho-e"Your full name is: $firstName $lastName"Read usage:read[-ers][-a 数组][-d

Shell Displays color output

Format: Echo"/033[Word background color; font color m string/033[control code"If you simply display the font color can be fixed control code bit 0m. Format: Echo"/033[Word background color; font Color m string/033[0m"Word Background color range:40-49

Several methods of shell script execution, shell script

Several methods of shell script execution, shell scriptYou can execute shell scripts in the following ways: 1. The relative path method must be cd to the script path first. [Root @ banking tmp] # cd/tmp [root @ banking tmp] #./ceshi. sh script

[Linux] shell multi-process concurrency-version details, linuxshell

[Linux] shell multi-process concurrency-version details, linuxshell Business background The schedule. sh script schedules the execution of the user's trajectory project script. Part of the Code is as follows: #! /Bin/bashsource/etc/profile; export

Total Pages: 541 1 .... 372 373 374 375 376 .... 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.