Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. who -u | cut -c 1-10,38-50 > /tmp/idle$$
  2.  
  3. for idleSession in `cat /tmp/idle$$ | awk '{print $3}'`
  4. do
  5.  
  6. if [ "$idleSession" -gt 30 ]; then
  7. echo $idleSession
  8. fi
  9. done
  10.  
  11. user_test.sh: line 6: [: 14:25: integer expression expected
  12.  
  13. who -u | cut -c 1-10,38-50 > /tmp/idle$$
  14.  
  15. for idleSession in `cat /tmp/idle22 | tr ":" " " | awk '{print $4}'`
  16. do
  17. if [[ $idleSession -gt 40 ]]
  18. then
  19. echo "$idleSession"
  20. fi
  21. done
  22.  
  23. for idleSession in `cat /tmp/idle22 | awk '{print $3}'`
  24. do
  25. comp=`cat /tmp/idle22 | tr ":" "n" | awk '{print $3}'`+`cat /tmp/idle22 | tr ":" "n" | awk '{print $4}'`
  26. if [[ $comp -gt 30 ]]
  27. then
  28. echo "$idleSession"
  29. fi
  30. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement