TemporalBeing

Bash Directory Scripting

Apr 12th, 2011
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.22 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #DIRECTORIES=`ls -lQ|grep ^d|cut -f 2 -d '"'`
  4. DIRECTORIES=`find -maxdepth 1 -type d -print`
  5.  
  6. for DIRECTORY in ${DIRECTORIES}
  7. do
  8.     if [ -d ${DIRECTORY} ]; then
  9.         # do something on the directory
  10.     fi
  11. done;
Advertisement
Add Comment
Please, Sign In to add comment