When we write the shell, there will be such a scene:
For example: I want to back up the passwd file and back it up to bak_path=”/mnt/sql_bak/”
And the file name is bak?
Get used to the shell like this:
#!/bin/shbak_path="/mnt/bak/"cp $/etc/passwd $bak_pathbak
But this will find $bak_pathbak this system Will treat it as a variable name, not based on the above variable, and then append a bak. In fact, there are two ways to solve this problem. In the bak_path, don't add ”/” that is, bak_path=”/mnt/bak”.
and then cp $/etc/passwd $bak_path/Bak this way. The second is ${} to be said today. Bak_path=”/mnt/bak” The path is still this. The following cp $/etc/passwd ${bak_path}bak will do this.
The second scenario must be done in the shell to the result of a command. This time you need to use $()
For example: I want to kill a process, I want to close Drop pid for 1915 this tomcat
First I have to get this pid first. Ps -ef
1. Lock the redundant self-built account in the systemCheck method:Execute the command#cat /etc/pas
The Linux operating system is an open source, free operating system that is not only secure, stable,
Mono is a cross-platform, open source .NET development framework. Support for Linux systems, which
This period win8.1 Mac OS X 10.9 Mavericks Two operating systems almost simultaneously released, i
Under Linux. a/.so/.la target library difference
Powerful screen commands in Linux systems
Detailed Linux system startup process and system initialization
Fedora 15 installed nvidia driver
Physical address to virtual address mapping
How do I view the specific release version of Red Hat Enterprise Linux?
Software-only dual-system hot standby solution in-depth analysis
Win 10 adds "Microsoft Wi-Fi" tool to provide outdoor Wi-Fi access service
Win7 can't set up a home group on this computer.
Learn about Windows 7 system security mode
What is the network disk? Which is better?
How to modify the Windows version to set the default item to start
Several shutdown methods for Windows 8
Detailed TAR command parameters
Win10 upgrade failure program can not install the prompt 80070003 error solution
Windows 2000 virtual host basic permissions settings
Win10 enters a new phase: technology preview to consumer preview stage