Skip to content

Instantly share code, notes, and snippets.

@qinshulei
Created July 30, 2015 09:13
Show Gist options
  • Select an option

  • Save qinshulei/cd4a95af8f3a6decd81d to your computer and use it in GitHub Desktop.

Select an option

Save qinshulei/cd4a95af8f3a6decd81d to your computer and use it in GitHub Desktop.
a example use bash regex
cd ${WORKSPACE}/mbn
mbn_array=( $(ls *.mbn) )
for mbn_name in ${mbn_array[*]}; do
if ! [[ $mbn_name =~ Y.*\.mbn ]]; then
printf "rm -rf %s \n" "${mbn_name}" >> lftp.cmd
printf "put -c %s \n" "${mbn_name}" >> lftp.cmd
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment