で終わるファイルを取得します。、できること:
1.R
list.files(path='/home/test', all.files=TRUE, pattern="\\.$")
また
list.files(path='/home/test', all.files=TRUE, pattern=".+\\.$")
R で \ を 2 倍にする必要があります。どちら.+\.$
も使用できません\.$
2.パイソン
import os
import re
for root, dirs, files in os.walk("/home/test"):
for file in files:
if re.search(".+\.$",file):
print file
Python で.+\\.$
or\.$
またはを使用できます 。\\.$
3.シェル
find /home/test -regex ".+\.$"
シェルでも「.+\.$」を使用できます
1.と
の間の posix の方法を知りたい です。 2.シェルで
使用できないのはなぜですか?.+\\.$
.+\.$
find /home/test -regex "\.$"