亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Korn Shell(K Shell) Notes (I)

系統(tǒng) 2518 0

Korn Shell Notes

1 Useful Cmds

wc - display a count of lines, words and characters in a file.
It can be used to count the numbers together with other commands, such as ls, who and so on.

cut - cut out selected fields of each line of a file.
The name of each unique user that is logged on is displayed using this command:
$ who | cut —f1 —d' ' | sort —u
anatole
root

print is a Korn shellspecializedcommand which is similar to echo .

nl - line numbering filter.

2 Conditional Execution

You can implement a simple if command by using the && and || operators together like this:
command1 && command2 || command3
If command1 returns true, then command2 is executed, which causes command3 to not be executed. If command1 does not return true, then command2 is not executed, which causes command3 to be executed.

3 Grouping Commands

Commands enclosed in {} are executed in current shell. If
$ echo "This is file temp:" ; cat temp | nl
This is file temp:
1 The rain in Spain
2 falls mainly on the plain
then by using {}s, the output will be:
$ { echo "This is file temp:"; cat temp ; } | nl
1 This is file temp:
2 The rain in Spain
3 falls mainly on the plain
There must be whitespace after the opening {, and commands within the {}'s must be terminated with a semi-colon.

Commands enclosed in () are executed in a subshell. Subshells are generated whenever you enclose commands in ()'s, perform command substitution, for background processes, and for coprocesses.A subshell is a separate copy of the parent shell, so variables, functions, and aliases from the parent shell are available to the subshell. However, subshells cannot change the value of parent shell variables, functions, or aliases.

4 Redirecting Standard Output

By using the > symbol, the standard output of a command can be redirected to a file, instead of your terminal.

You can also use the > command to create an empty file:
$ > tmp
$ ls —s tmp
0 tmp
This is equivalent to touch tmp .

Standard output can be appended to a file by using the >> redirect operator.

Standard output is closed with the >&- redirect operator:
$ echo "This is going nowhere" >&-
$


Korn Shell(K Shell) Notes (I)


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 成人精品一区二区三区中文字幕 | 国产精品久久久久久福利69堂 | 久久a毛片| 四虎永久在线观看免费网站网址 | 亚洲操片| 国产99久久九九精品免费 | 九九久久精品这里久久网 | 好好的曰com久久 | 熊出没之重启未来免费观看 | 狠狠色丁香久久婷婷综合五月 | 九草在线免费观看 | 中文字幕精品视频在线观 | 丰满寡妇一级毛片 | 四虎在线免费观看视频 | 免费一级a毛片免费观看欧美大片 | 欧洲精品 | 福利在线影院 | 亚洲综合一区二区三区 | 天天草天天干天天 | 日本人一级毛片视频 | 久久国产精品免费视频 | 97在线观看视频免费 | 国内精品久久久久鸭 | 色视频网站在线观看 | 91精品国产闺蜜国产在线 | 级毛片 | 亚洲激情区 | 中文字幕精品亚洲无线码二区 | 天天射天天干天天 | 国产色婷婷亚洲 | 久久综合九色综合97伊人麻豆 | 农村寡妇一级毛片免费看视频 | 综合色99| 黄色影院免费 | 欧美一区二区三区精品 | 欧美成人免费午夜影视 | 久草在线视频首页 | 四虎影永久在线高清免费 | 色老老精品偷偷鲁 | 亚洲综合涩 | 国产国拍亚洲精品永久不卡 |