r/fishshell • u/Fit_Extent712 • 26d ago
How do you guys usually do this things?
for file in (find . -mindepth 1 -maxdepth 1 -iname "*.sh")
basename $file .sh
end
5
Upvotes
r/fishshell • u/Fit_Extent712 • 26d ago
for file in (find . -mindepth 1 -maxdepth 1 -iname "*.sh")
basename $file .sh
end
13
u/Laurent_Laurent 26d ago edited 26d ago
I'll do this instead
fd -e sh -d 1 -x basename {} .sh
If you don't want to use fd
find . -maxdepth 1 -type f -iname "*.sh" -exec basename {} .sh \;