3 ms·
> Bash script to append a .txt extension to a filename Why?
by uggedal 17y ago
> Bash script to append a .txt extension to a filename
Why?
- silentbicycle 17y agoAnd regardless of whether it's necessary in the first place, why is it a bash script rather than a sh script? Very few of these use bash-specific extensions, and the BSDs don't necessarily have bash installed. Things like that make porting from Linux to BSD and other Unices tons of fun.
- mitechka 17y agoA more general case would be: How to change a pattern in a bunch of file names from X to Y: for i in *X*; do mv $i ${i/X/Y}; done
- ori_b 17y agoOr just use 'rename': $ rename s/foo$/bar/ *foo