Created
April 27, 2022 16:02
-
-
Save anikolaienko/b3e224752952f1f70ad9667cc36fe2b9 to your computer and use it in GitHub Desktop.
Run command for each line in file
This file contains hidden or 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 | |
# Example: run_cmd_foreach_line_in_file.sh command file_with_lines.txt | |
echo Start | |
while read p; do | |
$1 $p | |
done < $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment