Script: Bash: AIX: If file in directory then

This is a short special page just dedicated to one command or script. The purpose here is just for me to learn scripting. I think most people will think these snippets are too simple too take notice from.
for i in `ls -1 | grep was-`; do if [ -f $i/.run ]; then echo start slot $i; fi; done
  • ls -1 lists all files and directories each on a separate line
  • [ -f ] is true if listed file is a regular file

Discussion

Enter your comment:
 
scriptbashaix1.txt · Last modified: 2010/06/15 13:57 by sjoerd