Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 674 Bytes

README.md

File metadata and controls

33 lines (26 loc) · 674 Bytes

README

Demonstrates techniques for globbing and operating on sets of files

TODO:

  1. Use globbing from shell
  2. Using globbing in scripts
  3. shopts and controlling behaviour
  4. path expansion
# For each directory name create an empty file in the out directory with the filename the same as the directory 
mkdir ./out
echo ../* | xargs -n1 | sed 's/..\//.\/out\//g' | xargs -I % touch % 
# For each directory echo out the name
find .. -name "[0-9][0-9]_*" -exec echo {} \; 
# Find all shell scripts with shebang.
grep -R "/usr/bin/env" --include="*.sh" ../* 
# zsh
setopt extendedglob
ls ^d*.txt
unsetopt extendedglob