Skip to content

Instantly share code, notes, and snippets.

@martijngastkemper
Created May 30, 2014 10:47
Show Gist options
  • Save martijngastkemper/39e448fcde307a438953 to your computer and use it in GitHub Desktop.
Save martijngastkemper/39e448fcde307a438953 to your computer and use it in GitHub Desktop.
Search a file by version
#!/bin/bash
fromVersion=$1
if [ -d .sql-update ]
then
start=false
for sqlFile in `ls -v .sql-update/*`
do
if [[ $sqlFile == *$fromVersion* ]]
then
start=true
fi
if $start
then
echo $sqlFile
fi
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment