From nbah, 1 Year ago, written in Plain Text.
This paste is a reply to bequap from nbah - view diff
  1. #!/bin/bash
  2.  
  3. WGCM="/media/nbah/WdEx/Hunaipe"
  4. WTSI="/media/nbah/WdEx/Tectugen"
  5. VERA[0]="/home/nbah/Desktop/bin/"               #HBIN
  6. VERA[1]="/media/bau/Documents/"                 #BDOC
  7. VERA[2]="$WTSI/"                                                #WELS
  8. VERA[3]="$WTSI/KILLTHEM/"                               #KILL
  9. VERA[4]="$WTSI/motog2/"                                 #GOLA
  10. VERA[5]="$WGCM/Aprendiz/"                               #ADIZ
  11. VERA[6]="$WGCM/Aprendiz/Infra/CST-RC/"  #ADI2
  12. VERA[7]="$WGCM/Treino/"                                 #MALE
  13. VERA[8]="$WGCM/Util/"                                   #UTLS
  14. VERA[9]="$WGCM/Social/"                                 #SALS
  15. VERA[10]="$WGCM/Tesouro/negocios/"              #NEGA
  16. VERA[11]="$WTSI/russo/potil/xec/"               #XECA
  17.  
  18. BINA[2]="-iname wel-* -o -iname vir-*"
  19. BINA[3]="-iregex .*k[0-9]{4}-.*"
  20. BINA[4]="-iname gola-*"
  21. BINA[5]="-iname adiz-*"
  22. BINA[6]="-iname adi2-*"
  23. BINA[7]="-iname treino-*"
  24. BINA[8]="-iname util-* -o -iname faz-*"
  25. BINA[9]="-iname social-*"
  26. BINA[10]="-iname tn-*"
  27. BINA[11]="-iname xec-*"
  28.  
  29. while [ ! -d "${VERA[1]}" ] || [ ! -d "$WGCM" ]; do #BAU e WDEX
  30.         if ! grep -qsi '/media/bau' /proc/mounts; then #BAU desmontado
  31.         printf '  Autentique a entrada a ptnn'
  32.         gksu 'udisksctl mount -b /dev/sda8'
  33.         printf '  udiskctl is working...n'
  34.         sleep 2
  35.         else
  36.         printf '  proceed, BAU acessiveln'
  37.         fi
  38.  
  39.         verm=$(readlink /dev/disk/by-uuid/16C226ACC2268FD3 |awk -F/ '{print $NF}')
  40.         #if ! grep -qsi '/media/nbah/WdEx' /proc/mounts; then  #WdEx usb desconectado
  41.         if ! grep -qsi /dev/"$verm" /etc/mtab ; then
  42.         printf '  Espete o usb...n'
  43.         read -n 1 -r -p "Pressione teclado quando estiver pronto!"
  44.         udisksctl mount -b /dev/"$verm"
  45.         else #if df -h | grep -q /storage/emulated/0 ; then
  46.         printf '  proceed, Subindo...n'
  47.         fi
  48. done
  49.  
  50. dirpah="${VERA[1]}"
  51. cd $dirpah &&
  52. printf 'debug /BDOC/ %sn' "$PWD ${dirpah%/}" #dbgBDOC
  53. if [ "$PWD" = "${dirpah%/}" ]; then
  54. #for (( fsourc=2; fsourc<${#BINA[@]}+2; fsourc++ )); do
  55. #find . -type f * -exec sh -c 'for loop' find-sh {} + #dbgf3
  56. for fsourc in "${BINA[@]:2:9}"; do #:I:9 -ge {:2:N}
  57.         #printf '%sn' "${BINA[@]:2:9}"
  58.         case "$fsourc" in
  59.         -iname *)
  60.         #printf 'array string is name: %sn' "$fsourc" #dbgn2 items
  61.         #printf 'array string is name: %sn' "${BINA[$fsourc]}" #dbgn1 index
  62.         #find -print0 | xargs --null printf '%sn' #dbgf1
  63.         find . -type f "$fsourc" -print0 |xargs --null printf '%sn' #dbgf2
  64.         #find . -type f -iname "${BINA[$fsourc]}" -print0
  65.         #| rsync -han --info=NAME1,PROGRESS2 --partial --partial-dir=.rsync-partial -0 --files-from=- . ${VERA[$fsourc]}
  66.         ;;
  67.         *)
  68.         #printf '       array string is regex: %sn' "$fsourc" #dbgr2 items
  69.         #printf 'array string is regex: %sn' "${BINA[$fsourc]}" #dbgr1 index
  70.         find . -type f -regextype posix-extended "$fsourc" -print0 | xargs --null printf '%sn' #dbgf
  71.         #find . -type f -regextype posix-extended -iregex "${BINA[$fsourc]}" -print 0
  72.         #| rsync -han --info=NAME1,PROGRESS2 --partial --partial-dir=.rsync-partial -0 --files-from=- . ${VERA[$fsourc]}
  73.         ;;     
  74.         esac
  75. done
  76. fi
  77.  
  78. dirpah="${VERA[0]}"
  79. cd $dirpah &&
  80. printf 'debug /HBIN/: %sn' "$PWD, ${dirpah%/}" #dbgHBIN
  81. #if [ "$PWD" = "${dirpah%/}" ]; then
  82. #for fsourc in "${BINA[*]: -1}"; do #: -1 -le {: N} dbgfind
  83. #       find . -type f "$fsourc" -print0 |xargs --null printf '%sn'
  84. #done
  85. #cd $dirpah &&
  86. #find . -type f -iname 'xec-*' -print0
  87. #| rsync -han --info=NAME1,PROGRESS2 --partial --partial-dir=.rsync-partial -0 --files-from=- . ${VERA[4]};
  88. #fi

Replies to bequap rss

Title Name Language When
Bequap nbah bash 1 Year ago.
captcha