local -r opts="$3"
local -r id=$(youtube-dlc --get-id "$uri")
- local -r title=$(youtube-dlc --get-title "$uri" | sed 's/[^A-Za-z0-9._-]/_/g')
+ local -r title=$(youtube-dlc --get-title "$uri" | sed 's/[^А-Яа-яA-Za-z0-9._-]/_/g')
local -r dir="${base_dir}/${title}--${id}"
mkdir -p "$dir"
echo
printf '%smem by proc\n' "$indent_unit"
- ps -eo rss,cmd \
+ ps -eo rss,comm \
| awk -v total="$(free | awk '$1 == "Mem:" {print $2; exit}')" '
NR > 1 {
rss = $1
- cmd = $2
- n = split(cmd, path, "/") # _may_ be a path
- proc = path[n]
+ proc = $2
by_proc[proc] += rss
}
echo "${indent_unit}<->"
- printf '%sTCP: ' "${indent_unit}${indent_unit}"
+ printf '%sTCP\t' "${indent_unit}${indent_unit}"
sudo -n netstat -tnp \
| awk 'NR > 2 && $6 == "ESTABLISHED" {print $7}' \
- | awk -F/ '{print $2}' \
+ | awk '{sub("^[0-9]+/", ""); print}' \
| sort -u \
| xargs \
| column -t