Created
April 20, 2020 14:02
-
-
Save vasilii-b/2bd591715112ca02268a37cf333efa94 to your computer and use it in GitHub Desktop.
Linux CLI: find filenames and execute a command on the files (without file extension)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# get files without the extension | |
files=$(find ./ -name "filename*.html" -execdir basename {} .html \;) | |
for FILENAME in ${files} | |
do | |
#some-command-with-filename-as-param ${FILENAME}; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment