You are not logged in.
Pages: 1
Hello!
Can you help me with one question?
Why command:
pacman -Qi | awk '/^Name/{name=$3}/^Installed Size/{print $4$5, name}' | sort -h
perfectly works in term, but in alias gives syntax error:
awk: cmd. line:1: /^Name/{name=}/^Installed Size/{print , name}
awk: cmd. line:1: ^ syntax error
?
alias:
alias wpac=" pacman -Qi | awk '/^Name/{name=$3} /^Installed Size/{print $4$5, name}' | sort -h
kernel:
6.0.9-arch1-1
term:
alacritty 0.11.0 (8dbaa0bb)
shell:
fish 3.5.1-1
Thank you!
Last edited by Nick_Name (2022-11-23 15:30:45)
Offline
The shell tries to interpret $3, $4 & $5
https://www.chiark.greenend.org.uk/~sgt … iases.html
alias wpac=" LC_ALL=C pacman -Qi | awk '/^Name/{name=\$3} /^Installed Size/{print \$4\$5, name}' | sort -h"
(also notice the closing double quote)
Offline
The shell tries to interpret $3, $4 & $5
https://www.chiark.greenend.org.uk/~sgt … iases.htmlalias wpac=" LC_ALL=C pacman -Qi | awk '/^Name/{name=\$3} /^Installed Size/{print \$4\$5, name}' | sort -h"
(also notice the closing double quote)
It works!
Thank you very much
Offline
Pages: 1