Skip to content

Instantly share code, notes, and snippets.

@anikolaienko
Created April 27, 2022 16:02
Show Gist options
  • Save anikolaienko/b3e224752952f1f70ad9667cc36fe2b9 to your computer and use it in GitHub Desktop.
Save anikolaienko/b3e224752952f1f70ad9667cc36fe2b9 to your computer and use it in GitHub Desktop.
Run command for each line in file
#!/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