Reputation: 4944
How do I write a Bash script that, will select all files inside ~/test
with a .css
extension, so I can pipe them one by one into further actions?
Upvotes: 0
Views: 2170
Reputation: 63708
#!/bin/bash
for f in ~/test/*.css
do
# your command 'cmd'
cmd "$f"
done
To process a command for every .css
files in one line, try like this:
find ~/test -type f -name '*.css' -execdir cmd {} \+
Upvotes: 1