msoliver
(usa Debian)
Enviado em 29/07/2021 - 02:31h
jorgessn escreveu:
$comando = `awk 'NR>65 && /$userDelete/{c++;if(c=1) cmd="sed -i \""NR",+9d;\" /etc/samba/smb.conf";system(cmd);exit}' /etc/samba/smb.conf`;
Sem aspas na var
adminq@Q4OS:$ [02:04:20] └─»
saida=`awk 'NR>10 && /$var/{c++;if(c=1) cmd="sed \""NR",+9!d;\" texto.txt";system(cmd);exit}' texto.txt`
adminq@Q4OS:$ [02:04:38] └─» echo "$saida"
NADA NA SAIDA!
Com Aspas na var
adminq@Q4OS:$ [02:04:48] └─»
saida=`awk 'NR>10 && /'$var'/{c++;if(c=1) cmd="sed \""NR",+5!d;\" texto.txt";system(cmd);exit}' texto.txt`
adminq@Q4OS:$ [02:05:00] └─» echo "$saida"
/media/adminq/persistence/ALL/BACKUP/HISTORICO/
/media/adminq/persistence/ALL/BACKUP/HTML/
/media/adminq/persistence/ALL/BACKUP/images/
/media/adminq/persistence/ALL/BACKUP/INSTALL_SCRIPTS/
/media/adminq/persistence/ALL/BACKUP/KLM/
______________________________________________________________________
Att.: Marcelo Oliver
______________________________________________________________________