Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
arp242
on Feb 9, 2023
|
parent
|
context
|
favorite
| on:
Ask HN: Are alternative (oil, nu, etc.) shells usa...
In zsh you can use:
for f in **/data.json; mv $f $f:r.yaml
Which is even shorter, and easier. In bash you need a bit more syntax:
for f in **/data.json; do mv $f ${f%.json}.yaml; done
That second example can probably also be simplified a lot in a similar fashion.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: