213 Matching Annotations
- Jun 2018
-
github.com github.com
Tags
Annotators
URL
-
- Dec 2017
-
zhidao.baidu.com zhidao.baidu.com
-
#!/bin/sh(cat <<EOFstart(){ echo "start"}EOF) >/tmp/b
shell 如何把多行内容输出到一个文件
Tags
Annotators
URL
-
- Oct 2017
-
www.cyberciti.biz www.cyberciti.biz
-
;
This
semicolon
character is key for the whole thing to work.
-
- Feb 2017
-
content.netdevgroup.com content.netdevgroup.com
-
A shell script is a file of executable commands that has been stored in a text file. When the file is run, each command is executed.
The power of BASH!
-
- Aug 2015
-
stackoverflow.com stackoverflow.com
-
basic sorting
-
-
stackoverflow.com stackoverflow.com
-
good to know how to pipe for loop outlet. glad to know the syntax is what you'd expect.
-
- May 2015
-
askubuntu.com askubuntu.com
-
Run nm-tool | grep \*. That should show just the line with the SSID you are connected to.
-
-
stackoverflow.com stackoverflow.com
-
You can push an alternative branch to Heroku using Git. git push heroku-dev test:master This pushes your local test branch to the remote's master branch (on Heroku).
Push a local non-master branch to heroku master
-
-
www.tuxradar.com www.tuxradar.com
-
Every shell has some startup files that it consults for its configuration. Zsh has system-wide startup items in /etc/ (or, in distributions such as Ubuntu, in /etc/zsh/) and user-specific startup files (in the home directory). When Zsh starts up, it reads the following things in this order: /etc/zshenv and ~/.zshenv If the shell is a login shell: /etc/zprofile and ~/.zprofile If it’s an interactive shell: /etc/zshrc and ~/.zshrc If the shell is a login shell: /etc/zlogin and ~/.zlogin And when a user logs out from a login shell, Zsh reads /etc/zlogout and ~/.zlogout. To work out which commands you have to write in which startup files, it's important to know the different types of shells. A login shell is one that's spawned when you log in - for example, via SSH or on a virtual terminal. An interactive shell displays a prompt to the user where you can type commands - for instance, when you open a terminal window in Ubuntu. However, if you run ssh host somecommand, then this is a login shell, but is in fact a non-interactive one.
-
Every shell has some startup files that it consults for its configuration. Zsh has system-wide startup items in /etc/ (or, in distributions such as Ubuntu, in /etc/zsh/) and user-specific startup files (in the home directory). When Zsh starts up, it reads the following things in this order: /etc/zshenv and ~/.zshenv If the shell is a login shell: /etc/zprofile and ~/.zprofile If it’s an interactive shell: /etc/zshrc and ~/.zshrc If the shell is a login shell: /etc/zlogin and ~/.zlogin And when a user logs out from a login shell, Zsh reads /etc/zlogout and ~/.zlogout. To work out which commands you have to write in which startup files, it's important to know the different types of shells. A login shell is one that's spawned when you log in - for example, via SSH or on a virtual terminal. An interactive shell displays a prompt to the user where you can type commands - for instance, when you open a terminal window in Ubuntu. However, if you run ssh host somecommand, then this is a login shell, but is in fact a non-interactive one.
-
There's also a function periodic() that is executed every PERIOD seconds if the latter variable is set.
Periodic commands in ZSH
-
Zsh also makes it possible to run particular code automatically on certain occasions. You just have to define some special functions. The two most frequently used are chpwd and precmd. Zsh calls the former each time the current directory changes. The latter is called just before Zsh shows you a new prompt. Both functions are regularly used to show the current directory in the title bar of your terminal emulator. If you use programs other than the shell, which alter the title of your terminal emulator (Vim is one example), you should use precmd - it restores the title after another command has run. So this is how we show the current directory in the title bar (adapted from the manual page):
Run commands
-
REPORTTIME=5 TIMEFMT="%U user %S system %P cpu %*Es total"
Report times of long running shell commands
Tags
Annotators
URL
-