SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


actionifileindir
Differences

This shows you the differences between two versions of the page.

Link to this comparison view

actionifileindir [2013/05/18 08:55] (current)
sjoerd created
Line 1: Line 1:
 += Script: Bash: 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.
  
 +<​code>​
 +for i in `ls -1 | grep was-`; do if [ -f $i/.run ]; then echo start slot $i; fi; done
 +</​code>​
 +
 +* ls -1 lists all files and directories each on a separate line
 +* [ -f ] is true if listed file is a regular file
 +
 +{{tag>​scripts}}
actionifileindir.txt ยท Last modified: 2013/05/18 08:55 by sjoerd