Advertisement
Alex14291

bash

Dec 12th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. count=0
  4. while IFS= read -r line;
  5. do
  6. [[ $line != *[[:digit:]]* ]] && count=$(( count + 1 ))
  7. done < ~/.bashrc
  8.  
  9. printf 'We have %d number of lines without digits \n' "$count"
  10.  
  11.  
  12. #!/bin/bash
  13.  
  14. COUNT=0
  15.  
  16. while read LINE;
  17. do
  18. RESULT = $(echo $LINE | grep -L "[0-9]" | wc -l)
  19.  
  20. if [ $RESULT -eq1 ]; then
  21. COUNT=$((COUNT+1))
  22. fi
  23. done < ~/.bashrc
  24.  
  25. echo "Line count: $COUNT"
  26.  
  27. cat /etc/group | grep lightdm | tr -dc "0-9"
  28.  
  29. #!/bin/bash
  30.  
  31. for i in $(seq 1000)
  32. do
  33. echo " $i " >> file name
  34. done
  35.  
  36.  
  37. i="1"
  38.  
  39. while [ $i -lt 5 ]
  40. do
  41. touch "ex$i"
  42. i=$[$i+1]
  43. done
  44.  
  45. sudo cat /etc/default/useradd | grep -v [0-9]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement