Skip to content
On this page

File Folder Glob Utils

  • src/file-folder-glob-utils/
  • docs_bash.m
    • for now?

Find File Function

bash
#!/usr/bin/env bash
function jc-findFiles {
  local filename=$1 # must be double quoted
  local directory=${2:-"."}
  find $directory -type f -name $filename \
  -not \( -path "./node_modules/*" -prune \) \
  -not \( -path "*/.*" -prune \)
}
function jc-gh-chmod-shells {
  local filename=${2:-"*.sh"}
  local directory=${2:-"."}
  find $directory -type f -name $filename -not \( -path "./node_modules/*" -prune \) \
  -not \( -path "*/.*" -prune \)
  -exec git update-index --chmod=+x {} \; \
  -exec chmod +x {} \;
}
bash
#####

# add to .zshrc / .bashrc
code ~/.zshrc

#####

Dev

Directory

bash
tree src/file-folder-glob-utils
cd src/file-folder-glob-utils/posix

mkdir -p src/file-folder-glob-utils/posix/find-chmod-sh-files
cd src/file-folder-glob-utils/posix/find-chmod-sh-files

Misc

bash
#!/usr/local/env zsh
printenv |grep -iE "t[em]p"
printenv TMPDIR
bash
#!/usr/local/env zsh
printenv |grep -iE "t[em]p"
printenv TMPDIR
# n/a.. use /tmp or set it
powershell
$env:TEMP
$env:TMP
# dir
$env:LocalAppData/Temp