Guest User

Untitled

a guest
Jul 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.44 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. max='0'
  4. infile='tankor_orarend.txt'
  5.  
  6. for i in `seq 25` ; do
  7.     act=`head -n$i $infile | tail -1 | tr -cd '+' | wc -c`
  8.     if [ $act -gt $max ] ; then
  9.         max=$act
  10.         max_idx_array=''
  11.     fi
  12.     if [ $act -eq $max ] ; then
  13.         max_idx_array="$max_idx_array $i"
  14.     fi
  15. done
  16.  
  17. echo "A legtöbb ember, aki egyszerre ráér, az "$max", és ekkor érnek rá focizni:"
  18.  
  19. for i in $max_idx_array; do
  20.     head -n$i $infile | tail -1 | cut -f1 -d:
  21. done
Add Comment
Please, Sign In to add comment