此问题与我尝试将 Excel 文件中的问题及其答案导入 .txt 文件有关,Anki flashcard 程序按此处所述进行处理。我不能有超过 2 个字段,所以我需要选择一个字段。
按照 Anki 手册中的说明,从 LibreOffice 中存储为 CSV 的数据(分号作为字段分隔符 - 仅区分手册所说的内容)
Question ipsun; option 1 ; option 2 ; option 3 ; option 4 ; ... ; option n
Question ipsun; option 1 ; option 2 ; option 3 ; option 4 ; ... ; option n
...
Run Code Online (Sandbox Code Playgroud)
其中包含所有选项的每个条目都在一行中,即一个“抽认卡”。在一张卡片中,分号前的前部和分号后的后部。换行符中的第二张抽认卡,依此类推。
想要的输出应该是 UTF-8
Question ipsun; option 1 | option 2 | option 3 | option 4 | ... | option n
Question ipsun; …Run Code Online (Sandbox Code Playgroud) 伪代码是这个答案的延续
gsed 's/|/1)/g' 's/|/2)/2g' 's/|/3)/3g' 's/|/5)/4g' 's/|/5)/5g'
<input.csv >output.csv
Run Code Online (Sandbox Code Playgroud)
这当然不起作用。我对如何gsed管理这样的循环感兴趣。
如何gsed扩展到这样的循环?
脚本的运行时间差异很大。我想找到与 Matlab 的 timeit 类似的时间函数,这里描述。
例如,我在这里评估这些关于快速匹配、time LC_ALL=C grep -ao CDA r328_0002.raw | wc -l循环运行的命令
---------------------------------------------
Events real user sys
----------- ----------- ----------- ---------
40 0m0.044s 0m0.042s 0m0.005s
40 0m0.064s 0m0.062s 0m0.005s
40 0m0.046s 0m0.044s 0m0.005s
40 0m0.043s 0m0.042s 0m0.005s
40 0m0.047s 0m0.044s 0m0.005s
---------------------------------------------
Table: Events when Macbook Air 2013-Mid in Power Supply.
---------------------------------------------
Events real user sys
----------- ----------- ----------- ---------
40 0m0.056s 0m0.041s 0m0.011s
40 0m0.060s 0m0.047s 0m0.008s
40 0m0.041s 0m0.039s 0m0.006s …Run Code Online (Sandbox Code Playgroud) 我想在一周前更改许多图像的创建时间戳。代码
% http://askubuntu.com/a/62496/25388
touch -d "7 days ago" *.png
Run Code Online (Sandbox Code Playgroud)
输出
touch: invalid date format ‘1 one ago’
Run Code Online (Sandbox Code Playgroud)
操作系统:Debian 8.5
我想通过pdfjoin/ pdfunite/... 以在线程回答linux 命令合并 pdf 文件与数字排序和修改时间顺序中讨论的数字顺序加入 pdf 文件。如果您在线程中使用解决方案,它会按数字顺序和字母顺序排列顺序。这是与文件名,例如,你看到两个一分精度具有相同的修改时间问题,但Visceral早以第二精度(文件浏览器注意事项,并放Visceral第一位Modified的顺序。
Filename Modified
----- ---
3.THE ABC.pdf 10:39
3.Visceral abc..pdf 10:39
Run Code Online (Sandbox Code Playgroud)
完整的文件名
1.Description abc.pdf
2.Gabcd.pdf
3.THE ABC.pdf
3.Visceral abc..pdf
4.description of abc.pdf
5.Chraa..pdf
Run Code Online (Sandbox Code Playgroud)
提案 #1 按数字和字母顺序起作用,但不按数字和修改顺序起作用
# /sf/answers/1655048111/
ls -v *.pdf | ...
bash -c 'IFS=$'"'"'\n'"'"' read -d "" -ra x;pdfunite "${x[@]}" output.pdf'
Run Code Online (Sandbox Code Playgroud)
提案 #2 简化案例,但不处理文件名中的空格和其他特殊字符
# /sf/answers/1655048111/
pdfunite $(ls *.pdf | sort -n) output.pdf
Run Code Online (Sandbox Code Playgroud)
pdfunite --help关于排序没有任何内容,所以我认为它应该由ls/ …
我在 中只发现了以下内容apt-get,但似乎没有任何相关性,然后是纯粹的ftp客户。我认为 sftp 与 SSH ftp 相同,所以scp应该这样做,但我想要一个 GUI。我只想将文件移动到本地网络中的树莓派。
apt-cache search sftp | grep sftp
gesftpserver - sftp server submodule for OpenSSH
libnet-sftp-foreign-perl - client for the Secure File Transfer Protocol
libnet-sftp-sftpserver-perl - Secure File Transfer Protocol Server
openssh-sftp-server - secure shell (SSH) sftp server module, for SFTP access from remote machines
python-fs-plugin-sftp - Python filesystem abstraction - SFTP access
rssh - Restricted shell allowing scp, sftp, cvs, svn, rsync or rdist
ruby-net-sftp - Ruby …Run Code Online (Sandbox Code Playgroud) 我有时会在十六进制编辑器中看到星号 (*),例如
...
00001d0 0000 0000 0000 0000 0000 0000 0000 0000
*
00001f0 0000 0000 0000 0000 0008 0000 0000 0000
...
Run Code Online (Sandbox Code Playgroud)
它可能是某种分隔符。但是,还有许多其他分隔符。十六进制数据中这个星号是什么意思?
代码
find /tmp/ -type f \
\( -name "*.h" \) -o \( -name "*.cpp" \) -o \
\( \! -name "*.bak" \) -exec \
sed -i '1s/^/#include <stdint.h>\n/' {} +
Run Code Online (Sandbox Code Playgroud)
我不完全确定这是正确的方法。我直接写入文件而不使用临时文件。我想用.h和.cpp文件替换行的开头,但不替换.bak文件。
如何进行有效的更换?注意:我正在使用 GNU sed。
我尝试了 Terdon 的命令,插入应用于错误的文件:
$ cat test.sh
gfind /tmp/ -type f \
\( -name "*.h" -o -name "*.cpp" -o ! -name "*.bak" \) \
-exec gsed -i '1s/^/#include <stdint.h>\n/' {} +
$ sh test.sh
$ cat test.sh
#include <stdint.h>
gfind …Run Code Online (Sandbox Code Playgroud) 我有一个默认的 Debian 8.1 安装。我愿意
su
man apt<TAB>
Run Code Online (Sandbox Code Playgroud)
但什么也得不到。当我man apt-get以两种模式编写时,我确实看到了手册:作为用户 mas 和作为 root。但是,选项卡完成仅适用于用户模式。
如何在 root 后启用表完成?为什么默认情况下禁用此功能?
我可以在没有 Fido U2F 的情况下设置 SSH 密钥对,如所描述的SSH 代理在许多服务器上工作而无需重新键入?一些旗帜?在线程中。两步验证会非常好:私钥密码和 Fido U2F 验证也是如此。我不确定我们是否也需要 Fido/YubiKey 服务器,如线程Yubico Linux Login 中所述。我的动机是我经常忘记我的密码,如果在一步验证中使用这些密码很长。密码多长多难,一步验证本身也很弱。因此,我想在我的 Debian 中使用密钥进行两步验证,因为我认为密钥可以提高很多安全性。
门票发送给 YubiKey团队2017 年 2 月 22 日
Dear Sir/Madam,
We are thinking how to get 2-step verification with your key and keys in the following thread. Improvements are needed in FIDO U2F and OpenSSH parts. I am thinking how we can push the thing forward with You. Please, say what we can do because the feature request …Run Code Online (Sandbox Code Playgroud)