This article is the second chapter of "learning the bash shell" 3rd edition, command-line editing, Reading Notes. But we will not limit this.
In general, I just try to press it directly. If an error occurs, use the cursor and arrow on the left or right to modify the image, or use the upper/lower cursor to directly use the previous command or previous command to modify the image. That's all. I use VI and almost do not use Emacs. The author of this book
CentOS Grub, BASH fault, Solution
Introduction:
Two common faults of Grub: Grub. conf file loss and MBR damage (no matter what the recovery is, back up the file first)
1. Grub. conf file loss
Shell> rm-rf/boot/grub. conf # delete files, simulate faults, shell> reboot
# Faults:
GNU GRUB verstion 0.97 (634k lower / 1046400k upper memory )[ Minimal BASH-like line editing is supported. For the first word, TAB l
CentOS Grub, BASH fault, solution, centosbash
Introduction:
Two common faults of Grub: Grub. conf file loss and MBR damage (no matter what the recovery is, back up the file first)
1. Grub. conf file loss
Shell> rm-rf/boot/grub. conf # delete files, simulate faults, shell> reboot
# Faults:
GNU GRUB verstion 0.97 (634k lower / 1046400k upper memory )[ Minimal BASH-like line editing is supported. For the first
Fixed the GRUB error of "providing pocket BASH... like line editing" in Linux.
These two days I installed Elementary OS and Windows, and encountered a Grub error at startup. The command line displays the following information:
Minimal BASH like line editing is supported. For the first word, TAB lists possible command completions. anywhere else TAB lists possible device or file completions.
Provides a pocket
Fun Bash Script: select the structure if
3rd articles
Almost all programming languages have the concept of process control, that is, order structure, selection structure and loop structure.
The selected structure is also called the branch structure, such asIfAndSwitchStatement.If condition
I have already discussed the use of the test Expression and Its Simplified [] Operator. These judgment statements can be used as conditions for the if structure.
In
On Build2016, Microsoft has made a big move for the developers, and that is the WIN10 anniversary. Update the Integrated native Linux Bash command line feature, which will allow developers or users to run Linux programs on the WINDOWS10 system as a command line. Now WIN10 running Linux GUI applications has also come true.Microsoft is in the WIN10 First Anniversary update preview 14316, which contains most of the announced content, including an importa
In bash, escape is a method for referencing a single character. the escape character (\ backslash) before a single character tells shell that this character does not need to be interpreted specially, and only serves as the literal meaning. however, in some commands and software packages such as echo and sed, escaping a character may lead to an opposite effect... in bash, escape is a method for referencing a
Paste the following readme:#myexpect V1.0 Released#auth [email protected]#env descriptionMyexpect server Requires:bash is needed OfcourceExpect for answer passwordVSFTPD for client-to-down load scripts upload files etc.Myexpect client Requires:ftp for uploadWget for down loadPython possible if want to run Python scripts #file and Direcory description#files in Myexpect serverTree/server-scripts/server-scripts: Scripts in Myexpect server├──exc-py.sh: You can use exec-py.sh [yourscript.py] to run P
Bash Script programmingStacking of commandsScripting: Interpreter parsing executionShell: Interactive interface, programming environmentShell: Be able to provide some internal commands, and can be through the PATH environment variable to find external commands, the command to submit to the kernel to start a process;Programming Environment:Process Control StatementsSequential executionLoop executionSelect ExecuteCondition test: True, FalseElements of a
Bash functions, unlike functions in most programming languages does not allow you to return a value toThe caller. When a bash function ends It return value is it Status:zero for success, Non-zero for failure. ToReturn values, can set a global variable with the result, or use command substitution, or you can pass inThe name of a variableto use as the result variable. The examples below describe these differe
Linux bash programs are very important for programmers, especially for debugging Linux bash programs when using shell programs. There are many technical points that need attention during debugging. Next we will learn in detail.
Linux bash program debugging
Errors are inevitable during programming. Sometimes, debugging takes more time than programming, as does she
Several common configuration files in Bash
Login shells reads the following Startup file:
File
Content
/Etc/profile
Global configuration files open to all users
~ /. Bash_profile
A user's personal Startup file can be used as a personal global setting
~ /. Bash_login
If~ /. Bash_profileBash tries to read the script if it cannot be found.
~ /. Profile
If the two files~ /. Bash_profile, ~ /. Bas
first column of each row indicates the type of the file[[Email protected]]# ll/usrtotal124dr-xr-xr-x. 2 root root 36864 10:15 bin-: Normal fileD: Catalog fileB: Block device filesC: Character device fileL: Symbolic Link file (similar shortcut)P: Named pipe fileS: Socket fileBasic features of Bash (i)( 1 ) Command HistoryA list of commands that bash has executed in the pastThe command history of the current
As a result of personal brain mutilation, using homebrew to install bash, use the CHSH command to change it to a specific version of the Brew installation bash, and after the last brew update bash, the shell is completely useless ...Helpless can only add a new administrator account and then change the original account of the default shell back, this event told me
Define subsequent command execution log output path in bash script
#!/bin/bashlogdir= ' Date +%f ' exec >/tmp/logdir.log//This time defines the execution output log path for subsequent commands df-htop
For loop
Loops allow you to repeat a fixed number of times, and during loop code execution a special variable called a loop variable is given a different value;The For loop is well suited for handling parameters on the command line an
sharing: www.ndislwf.com or ifxvn.com.-Icon Component (addition icons): Choose whether to create a Quick Launch bar icon or whether to create a desktop shortcut;-Desktop Browsing (Windows Explorer integration): The way to browse the source code, a separate context browser only using bash or git GUI tools only; Advanced contextual browsing methods using the Git-cheetah plugin plugin;-Association Profile: whether to associate a git configuration file t
The Mac comes with Bash 3.2, and the latest bash is 4.9 and needs to be upgraded to support new features like associative arrays.1. Brew Install Bash2, install into the/usr/local/bin/bash inside. You can complete the boot using the new version of Bash by modifying the/etc/shells file.3, however, can not change the vers
Tags: Linux login failure1th ChapterThe display failure is:the login system is displayed as: -bash-4.2$ fault2nd ChapterHow to resolve:Failure reason: The current user's environment variable file is missing or corrupt,Solution: Copy the correct files to the user's home directory ,User Home Directory template path /etc/skel/# #复制变量到加家目录-bash-4.2$ ll-aTotal 20Drwxr-xr-x. 2 root root 4096 Nov 21 2014.Drwxr-xr-
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.