Reputation: 14038
I'm trying to recursively iterate over all my .html files in a directory and convert them to .jade using a bash script.
#!/bin/bash
for f in ./*.html ./**/*.html ; do
cat $f | html2jade -d > $f + '.jade';
done;
Naturally the $f + '.html'
bit isn't correct. How might I fix this?
Upvotes: 1
Views: 409
Reputation: 185161
#!/bin/bash
shopt -s globstar
for f in **/*.html; do
html2jade -d < "$f" > "${f%.html}.jade"
done
Upvotes: 4
Reputation: 798676
Concatenation is the default for most cases.
... > "$f.jade"
Also:
html2jade ... < "$f"
And:
... > "${f%.html}.jade"
Upvotes: 1