You are not logged in.

#1 2023-10-11 00:28:08

Arthurmeade12
Member
From: U.S.A
Registered: 2022-10-18
Posts: 32
Website

Pacman stdout from script

I created this script to be able to repeatedly perform pacman commands without retyping pacman. However, pacman does not output on stdout (however, it does on stderr.) Is there a quirk of pacman that I am missing?
Thanks for any help.

#!/usr/bin/env bash
if [[ "$(whoami)" != 'root' ]]
then
    printf '%s\n' 'Must be root (2)'
    exit 2
fi
while true
do
    printf '%s' ' ==> '
    #shellcheck disable=2162
    read INPUT
    #shellcheck disable=2086
    pacman -${INPUT}
done

Offline

#2 2023-10-11 02:06:53

solskog
Member
Registered: 2020-09-05
Posts: 418

Re: Pacman stdout from script

Your script works perfect for me. though, I would suggest using sudo instead for root user.

sudo pacman -${INPUT}

Offline

#3 2023-10-11 22:43:29

Arthurmeade12
Member
From: U.S.A
Registered: 2022-10-18
Posts: 32
Website

Re: Pacman stdout from script

Silly me. I was using Qtdq to test this script when in fact I had no dependencies that were not needed. Non-issue.

Offline

Board footer

Powered by FluxBB