Created
January 18, 2021 20:33
-
-
Save pandorica-opens/96e7ff5a461afb9314c910ce86d62011 to your computer and use it in GitHub Desktop.
piping with bash
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 | |
| > oldFiles.txt | |
| files=$(grep ' jane ' ../data/list.txt | cut -d ' ' -f 3 -s) #--output-delimiter='/n') | |
| echo $files | |
| cd .. | |
| echo $PWD | |
| for file in $files; do | |
| echo $PWD$file | |
| if test -e $PWD$file; then echo $PWD$file >> scripts/oldFiles.txt; echo 'exists'; else echo "File doesn't exist"; fi ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment