1.shell of learning.There are three types of shells:/bin/sh,/bin/csh,/bin/ksh.See what kind of shell is currently in use: Command env (displays the environment variables for the current operating system).Change the shell type: chsh-s/bin/cshShell
For tired print and Echo, try a little bit of fresh effort.1. Using the shell's execution optionsThe common execution directives for SH and bash are:-N,-X,-C,-V.which-N is a shorthand for noexec, which is to do only the syntax checking of the script
SSH Main parameter description-L Specify Login user-P Set Port number-F run in the background, and recommended with the-n parameter-n redirects standard input to/dev/null to prevent reading standard input-N Do not execute remote command, only port
Distance from the last write and a period of time, the period has been followed by private food learning, or did not develop a regular record of the habit, today to write the first script.After a few days of accumulation, learning the next shell
How to use:1. Download the deltarpm-version.el6.x86_64.rpm python-deltarpm-version.el6.x86_64.rpm createrepo-version.noarch.rpm for the system version , put it in the sibling directory corresponding to the script.2. Take the rpm that needs to be
Original title: https://leetcode.com/problems/transpose-file/Given a textfile file. txt, transpose its content. You may assume this each row have the same number of columns and each field are separated by the' 'character. For example,if file. txt
There are accidents, suddenly, with FileZilla download files on the FTP to the desktop, the prompt " cannot determine the drag-and-drop operation target." Because the shell is not installed correctly "The solution is simple, just take the following
Configuration Management Remote ScriptingVim/srv/salt/shelltest.slsShell_test:Cmd.script: #模块和函数-Source:salt://test/1.sh #脚本源路径-User:root #客户端执行者身份, can be other usersvim/srv/salt/test/1.sh#!/bin/bashTouch/tmp/111.txtif [-d/tmp/1233]Thenrm-rf/tmp/123
To achieve ping a network segment of all the IP, and detect the network connection status is normal, many methods can be implemented, the following is a brief introduction of two, as follows:Script 1#!/bin/sh# Ping Network segment all IPs# 2012/02/05
1. Check if the remote port is open for bash:
echo >/dev/tcp/8.8.8.8/53 && echo "open"
2. Turn the process into the background:
Ctrl + z
3. Transfer the process to the foreground:
fg
4. Generates a random
Conditional test Method OneTest command:if test $n 1-eq $n 2then "Thenumber isequal"fi[] Commandif [$n 1-eq $n 2]then " The number is equal " fiThe test command and [] are equivalent in bash.Condition test Mode Two((expression)) test the
There's nothing going on today. A lot of operations in the shell about efficiency issuesNo, nothing else, no use.It's just something to do.At first, that's the arithmetic.What I recommend here is to use the $ (()) method for simple
Interactively change password 1. SSH remote to the host; 2. Switch to root account;[generally switch to root for password modification, if the ordinary user to modify their own password, to enter the original password, and then the new password to
#!/bin/bash#It ' s written by Caibingsen#!/bin/bash#It ' s written by Caibingsen#date: 2016-03-15#while设置成死循环, re-enter when the IP entered does not meet the criteriaWhile:DoRead-p "Please enter the IP address to be judged:" IP#判断输入的ip地址是否仅由数字和点组成,
█ Start line The shell program must start with the following line (must be in the first line of the file)#!/bin/shThe symbol #! is used to tell the system that the parameter behind it is the program used to execute the file █ executable when editing
Create 20 users with shell script, ask 20 users to specify the home directory as/share/home/, and give each user randomly assigned a password, and finally record these user information in the log![[email protected] sbin]# vim 2.sh mkdir -p
The hill sort was proposed by D.l.shell in 1959, and the relative direct ranking has been greatly improved. Hill sort is also called narrowing the incremental sortBasic idea:First, the entire sequence of records to be sorted into a number of
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.