Skip to content

Instantly share code, notes, and snippets.

@pandorica-opens
Created January 18, 2021 20:33
Show Gist options
  • Select an option

  • Save pandorica-opens/96e7ff5a461afb9314c910ce86d62011 to your computer and use it in GitHub Desktop.

Select an option

Save pandorica-opens/96e7ff5a461afb9314c910ce86d62011 to your computer and use it in GitHub Desktop.
piping with bash
#!/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