Skip to content

Instantly share code, notes, and snippets.

@ivalexandru
Last active September 24, 2017 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivalexandru/eba841e8994e5f5b08187f28af53074f to your computer and use it in GitHub Desktop.
Save ivalexandru/eba841e8994e5f5b08187f28af53074f to your computer and use it in GitHub Desktop.
ForWhileUntil
#!/bin/bash
for VAR
in $(cat listaTelefoane | cut -d "0" -f 2 | egrep [0-9]{9})
#cauta in lista si taie de la dreapta lui zero,
#apoi raman doar 9 cifre din telefon, deci {9}
do
echo +40$VAR
#asta le listeaza pe toate ce corespund;
done
#!/bin/bash
clear
for VAR
in $(egrep -o [[:digit:]]{10} listaTelefoane)
#egrep alaturi de optiunea -o
#afiseaza doar regexul care face match
#fara optiunea -o afiseaza randul intreg
do
echo $VAR" e numar de telefon"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment