jueves, 12 de agosto de 2021

Linux Bash Loop with mysql

 #!/bin/bash

# sh_my_bach_run_this_loop.sh

for i in {1..5}

do

mysql -u USER -pPASSWORD -e "  delete from table where id = $i ;"

   echo "Welcome $i times"

done


... 

# add permission, run this on terminal

sudo chmod +x sh_my_bach_run_this_loop.sh

# run this on terminal

./sh_my_bach_run_this_loop.sh

No hay comentarios:

Publicar un comentario