Created
April 2, 2019 16:31
-
-
Save jayers99/c493ae26b6435af6410f5a965b9228eb to your computer and use it in GitHub Desktop.
take a pipe list of file paths and return the directory
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 | |
| # print just directory name from piped input of file paths | |
| while read line | |
| do | |
| dirname "$line" | |
| done < "${1:-/dev/stdin}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment