Skip to content

Instantly share code, notes, and snippets.

@harry830622
Last active January 13, 2020 08:39
Show Gist options
  • Save harry830622/c83fcebd65f30fc19bf2e92df31b5a74 to your computer and use it in GitHub Desktop.
Save harry830622/c83fcebd65f30fc19bf2e92df31b5a74 to your computer and use it in GitHub Desktop.
Iterate over files in a directory
#!/bin/env bash
# For example, iterate over files in the home directory.
dir=~
for f in $dir/*; do
echo $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment