How to count lines from result o/p?
by ddenial from LinuxQuestions.org on (#593BB)
Hello All
I want to count how many packages are there in flathub. So I issued the following command. Since I have multiple installations, It will ask which path before showing output.
Code:$ flatpak remote-ls flathub
Remote flathub' found in multiple installations:
1) system
2) user
Which do you want to use (0 to abort)? [0-2]:If I give line count, I get this error
Code:$ flatpak remote-ls flathub | wc -l
error: No remote chosen to resolve flathub' which exists in multiple installations
4I resolved this by adding --user option
Code:$ flatpak --user remote-ls flathub | wc -l
1658
But hypothetically, what if I didn't had --user option, and I have to give some intermediate answer, how then should I counted lines?
I hope my question is clear?
Thanks


I want to count how many packages are there in flathub. So I issued the following command. Since I have multiple installations, It will ask which path before showing output.
Code:$ flatpak remote-ls flathub
Remote flathub' found in multiple installations:
1) system
2) user
Which do you want to use (0 to abort)? [0-2]:If I give line count, I get this error
Code:$ flatpak remote-ls flathub | wc -l
error: No remote chosen to resolve flathub' which exists in multiple installations
4I resolved this by adding --user option
Code:$ flatpak --user remote-ls flathub | wc -l
1658
But hypothetically, what if I didn't had --user option, and I have to give some intermediate answer, how then should I counted lines?
I hope my question is clear?
Thanks