Redian新闻
>
命令后面加“> ./mylogfile.$$ 2>&1”这一串是什么意思呢?
avatar
命令后面加“> ./mylogfile.$$ 2>&1”这一串是什么意思呢?# Linux - Linux 操作系统
k*1
1
我是已经拿到绿卡的,但是我要长期回国工作,请问如何办理回美证啊?
办理回美证都需要什么文件呢?
多谢了!有知道的朋友请告知!
avatar
bz
2
给approv(xxx)搞S了。
avatar
X*7
3
我终于又一次看见了夕影刀。
然,因为生死旦夕,夕影刀发挥出了极大的力量,毫不留情地杀戮着范围内的一切。
“嘶——”刀风过后,我听见主人压抑地哼了一声,然后,我就觉得她的手一震,
血如瀑布般地顺着手指涌到了我身上!
主人捂胸踉跄后退,终于气力不继,单膝跪倒。我用力支撑着她,让她不至于倒下
——但是看见她胸口那致命的一刀后,我忽然失去了力气!身子一软,主人跌落在密室
的地面上。
“为什么?阿靖……为什么背叛我!”同样以手捂着心口涌出的鲜血,楼主不可思
议地看着地上垂死的主人,他目光中的悲哀和绝望令我目不忍视,“——为什么连你都
会背叛我!”
我想,他是太认真了,认真到已经忘了自己曾经对眼前这个女子明白地说过、如果
她有杀死他的能力,就把他的所有遗赠给她。
“那、那算是……背叛吗?”奄奄一息的主人吃力地回答了一句,再也无法继续了
——刚才他在濒死时自救的那几刀,已经毫不留情地削断了她的大动脉。
“知道吗?阿靖,我本来以为……这世上至少还有一件东西是可以相信的……”
楼主的激愤在最短的时间内平息了,取而代之的是淡淡的苦笑,认命的苦笑。他咳
嗽着,目光的萧瑟之意更加浓厚,然而,他咳出来的,都是黑色的血沫——我清楚地知
道,我刺中了他。刚才主人那样 猝及不防的一剑,已经刺破了他的心脉。
楼主缓缓地走过来,把主人轻轻从地上抱起,然后,就这样看着她,看着她死灰色
眼睛里映出来的自己的影子,苦笑着,叹息:“我本来是想信任你的……可是居然是你
来刺杀我!……你说,这世上还有什么是可以相信的?……”
“我、我本来也想相信你的!……”挣扎着,主人用尽所有力气冷冷笑着,讽刺地
看着他,“可你…可你到了现在,还对我演戏!……萧忆情……萧忆情……你做了那样
的事,还让我怎么相信你!”
我感觉主人的心跳在渐渐微弱下去,我也渐渐绝望。
然,我看了看身边的夕影刀,它也这样绝望地看着我,我知道,楼主也是垂危了。
“我做了什么?竟然让你这样杀我而后快吗?”楼主愕然地问,终于看不得主人嘴
角不断流出的殷红的血,解下手腕上的丝巾轻轻为她擦去,目光中,有难以言表的痛苦
和茫然。他的手一从心口放下,那里的血就如同喷泉般地涌了出来,每一滴,似乎都带
走了他的一分生命。
“你、你……为什么、为什么要派人斫断明烟的双足?!……太狠了……萧忆情,
我说过,我不许你对付她的!……”主人的眼里放出了不顾一切的光芒,同样痛心疾首
地,问一句,就努力吸一口气,这样,她才能坚持着不昏死过去。
“真的要斩草除根?……对一个孩子也不放过!……我、我说过……不许你…不许
你碰她的!”
“什么?……”楼主苍白的脸色更加苍白了,仿佛被人当胸一击,他喷出了一口血
,然后支持着,惊讶地分辨,“我、我不知道……我没有派人做这件事!”
“哈……说谎。”
avatar
d*o
4
大致知道是输出重定向,但 $$ 2 >&1这些是什么意思呢?
avatar
S*A
5
stderr redirect to stdout

【在 d*******o 的大作中提到】
: 大致知道是输出重定向,但 $$ 2 >&1这些是什么意思呢?
avatar
l*G
6
http://tille.garrels.be/training/bash/ch03s02.html#sect_03_02_0
$* Expands to the positional parameters, starting from one. When the
expansion occurs within double quotes, it expands to a single word with the
value of each parameter separated by the first character of the IFS special
variable.
[email protected] Expands to the positional parameters, starting from one. When the
expansion occurs within double quotes, each parameter expands to a separate
word.
$# Expands to the number of positional parameters in decimal.
$? Expands to the exit status of the most recently executed foreground
pipeline.
$- A hyphen expands to the current option flags as specified upon
invocation, by the set built-in command, or those set by the shell itself (
such as the -i).
$$ Expands to the process ID of the shell.
$! Expands to the process ID of the most recently executed background (
asynchronous) command.
$0 Expands to the name of the shell or shell script.
$_ The underscore variable is set at shell startup and contains the
absolute file name of the shell or script being executed as passed in the
argument list. Subsequently, it expands to the last argument to the previous
command, after expansion. It is also set to the full pathname of each
command executed and placed in the environment exported to that command.
When checking mail, this parameter holds the name of the mail file.
[Note] $* vs. [email protected]
The implementation of “$*” has always been a problem and realistically
should have been replaced with the behavior of “[email protected]”. In almost every case
where coders use “$*”, they mean “[email protected]”. “$*” Can cause bugs and even
security holes in your software.
The positional parameters are the words following the name of a shell script
. They are put into the variables $1, $2, $3 and so on. As long as needed,
variables are added to an internal array. $# holds the total number of
parameters, as is demonstrated with this simple script:
#!/bin/bash
# positional.sh
# This script reads 3 positional parameters and prints them out.
POSPAR1="$1"
POSPAR2="$2"
POSPAR3="$3"
echo "$1 is the first positional parameter, \$1."
echo "$2 is the second positional parameter, \$2."
echo "$3 is the third positional parameter, \$3."
echo
echo "The total number of positional parameters is $#."
Upon execution one could give any numbers of arguments:
franky ~> positional.sh one two three four five
one is the first positional parameter, $1.
two is the second positional parameter, $2.
three is the third positional parameter, $3.
The total number of positional parameters is 5.
franky ~> positional.sh one two
one is the first positional parameter, $1.
two is the second positional parameter, $2.
is the third positional parameter, $3.
The total number of positional parameters is 2.
More on evaluating these parameters is in Chapter 7, Conditional statements
and the section called “The shift built-in”.
Some examples on the other special parameters:
franky ~> grep dictionary /usr/share/dict/words
dictionary
franky ~> echo $_
/usr/share/dict/words
franky ~> echo $$
10662
franky ~> mozilla &
[1] 11064
franky ~> echo $!
11064
franky ~> echo $0
bash
franky ~> echo $?
0
franky ~> ls doesnotexist
ls: doesnotexist: No such file or directory
franky ~> echo $?
1
franky ~>
User franky starts entering the grep command, which results in the
assignment of the _ variable. The process ID of his shell is 10662. After
putting a job in the background, the ! holds the process ID of the
backgrounded job. The shell running is bash. When a mistake is made, ? holds
an exit code different from 0 (zero).
avatar
d*o
7
很好,多谢了

the
special
separate

【在 l*******G 的大作中提到】
: http://tille.garrels.be/training/bash/ch03s02.html#sect_03_02_0
: $* Expands to the positional parameters, starting from one. When the
: expansion occurs within double quotes, it expands to a single word with the
: value of each parameter separated by the first character of the IFS special
: variable.
: [email protected] Expands to the positional parameters, starting from one. When the
: expansion occurs within double quotes, each parameter expands to a separate
: word.
: $# Expands to the number of positional parameters in decimal.
: $? Expands to the exit status of the most recently executed foreground

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。