Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- declare -A tab
- tab ["Ala"] = "ma kota"
- echo ${tab["Ala"]} -wypisze pojedyncze słowa w petli ; echo ${!tab["Ala"]} - wypisze całe zdania (klucze)
- for i in ${tab[*]}
- do
- echo key=$i ,value =${tab[$i]}
- done
- ------------------
- decaler -A tab
- x=$(ps -eo ...)
- while read user pid mem cpu
- do
- let "tab[$user]++"
- done <<<"${x}"
- for i in ${!tab[*]}
- do
- printf "..." $i ${tab[*]} ....(dwie tablice)
- done | sort -k2 -n
- awk tez ma tablice asocjacyjną
- bc - jest do matmy
- ps -eo user,uid,pmem,cpu,comm | awk '{ile[$1]++}END{for (i in ile) printf "%10 %5d\n",i,ile[i] }' tablice w awk są wypelnione zerami
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement