我的系统时区是亚洲/德黑兰,它在夏季(春季向前)调整夏令时,在冬季调整;但是我确实需要禁用这些 DST 调整并将时区始终保持在 UTC+3:30。我如何在 Linux 中做到这一点?
主页
/
user-72456
αғsнιη's questions
αғsнιη
Asked:
2018-09-16 21:29:33 +0800 CST
通常,当我将一个文件名传递给当前目录中唯一由 Tab 自动完成的文件时,在它之前出现的命令然后按多个 Tab(错误地),相同的文件名多次完成,我应该删除或取消并重新开始.
有没有办法禁用此行为(不创建另一个文件或隐藏文件)?
ls <Tab>filename <Tab>filename <Tab>filename
αғsнιη
Asked:
2018-05-25 02:22:23 +0800 CST
αғsнιη
Asked:
2018-05-24 01:24:04 +0800 CST
我有一个pattern
具有以下值的变量:
\"something//\\anotherthing'
和一个包含以下内容的文件:
\"something//\\anotherthing'
\"something//\\anotherthing
\"something/\anotherthing'
\"something\anotherthing'
\\"something\/\/\\\\anotherthing'
当我将从文件中读取的行与==
操作符环境中的模式进行比较时,我得到了预期的输出:
patt="$pattern" awk '{print $0, ENVIRON["patt"], ($0 == ENVIRON["patt"]?"YES":"NO") }' OFS="\t" file
\"something//\\anotherthing' \"something//\\anotherthing' YES
\"something//\\anotherthing \"something//\\anotherthing' NO
\"something/\anotherthing' \"something//\\anotherthing' NO
\"something\anotherthing' \"something//\\anotherthing' NO
\\"something\/\/\\\\anotherthing' \"something//\\anotherthing' NO
但是当我对~
操作员做同样的事情时,测试永远不会匹配。(我期望YES
在第一行,如上所述):
patt="$pattern" awk '{print $0, ENVIRON["patt"], ($0 ~ ENVIRON["patt"]?"YES":"NO") }' OFS="\t" file
\"something//\\anotherthing' \"something//\\anotherthing' NO
\"something//\\anotherthing \"something//\\anotherthing' NO
\"something/\anotherthing' \"something//\\anotherthing' NO
\"something\anotherthing' \"something//\\anotherthing' NO
\\"something\/\/\\\\anotherthing' \"something//\\anotherthing' NO
要解决~
比较问题,我需要双重转义转义:
patt="${pattern//\\/\\\\}" awk '{print $0, ENVIRON["patt"], ($0 ~ ENVIRON["patt"]?"YES":"NO") }' OFS="\t" file
\"something//\\anotherthing' \\"something//\\\\anotherthing' YES
\"something//\\anotherthing \\"something//\\\\anotherthing' NO
\"something/\anotherthing' \\"something//\\\\anotherthing' NO
\"something\anotherthing' \\"something//\\\\anotherthing' NO
\\"something\/\/\\\\anotherthing' \\"something//\\\\anotherthing' NO
ENVIRON["patt"]
请注意第二列中打印结果的双重转义。
问题:
使用波浪号比较运算符时, awk中的转义序列在哪里发生?~
在$0
(或$1
, $2
, ...) 或在ENVIRON["variable"]
?
有人可以解释一下下面的awk
命令发生了什么吗?如果没有错误,那么为什么notme
没有得到打印,为什么我没有得到语法错误,那么对于右括号...}
需要用引号关闭...}'
?
$ awk '{print "me "$0 '"notme"} <<<"printme"
me printme
然后我会尝试这个:
$ awk '{print "me "$0 '"\"$(date)"\"} <<<"printme-at "
me printme-at Wed Apr 11 16:41:34 DST 2018
或者
awk '{print '"\"$(date)\""} <<<"run"
Wed Apr 11 16:56:38 DST 2018
正如它所显示的,这意味着我可以使用 shell 命令替换来做所有事情。
这是一个错误吗?或者也许是我找不到的特殊状态。
αғsнιη
Asked:
2018-03-20 10:32:41 +0800 CST
如何使用以下示例作为数据删除每个单独字段中的重复条目。
0x,9.4,,,#0,#UNIX#unix,#cli#L#فا#0#فا#0#L#SE#Cli#SE,#فارسی#فارسی#۱#1#١#1,bsh,#V & v
预期输出(删除所有重复的,不区分大小写,Unicode“波斯语#۱
/阿拉伯语#١
”的差异,条目的顺序以及应该保留哪个条目(忽略大小写)在这里无关紧要):
0x,9.4,,,#0,#unix,#cli#L#فا#0#SE,#فارسی#١#۱#1,bsh,#V & v
模式采用这种格式#x
,x
表示一个或多个字符长度的任何内容。