Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试递归遍历目录中的所有 .html 文件,并使用 bash 脚本将它们转换为 .jade 。
#!/bin/bash for f in ./*.html ./**/*.html ; do cat $f | html2jade -d > $f + '.jade'; done;
当然这个$f + '.html'位是不正确的。我该如何解决这个问题?
$f + '.html'
#!/bin/bash shopt -s globstar for f in **/*.html; do html2jade -d < "$f" > "${f%.html}.jade" done
大多数情况下,串联是默认设置。
... > "$f.jade"
还:
html2jade ... < "$f"
和:
... > "${f%.html}.jade"