pkg -oABI fails on amd64 in csh because of $(uname -p)

Besides that, for some time sh(1) is the default shell for root in FreeBSD.
I believe the switch for root from csh to sh was in 14.X so not really "for some time" because from 1.x to 13.X root default shell was csh.

bugzeo yes it's a "$SHELL" thing. the syntax you post is sh syntax which fails if shell is csh. Easy way to tell:
"echo $SHELL"
If it says csh/tcsh then syntax is wrong the "$() construct"

Tell us the output on the system you are trying to upgrade for:
freebsd-version
echo $SHELL
 
In amd64 the shell is csh and in arm64 is sh but i think could be caused by updating an old FreeBSD system when had the other shell as default. Still the commands can be made common for all shells.
 
The commands are common for both shells.
The problem is "shell expansion".

the $(uname -p) construct is sh for "run this command and substitute the output in the pkg command"
the backticks construct is csh for "run this command and substitute the output in the pkg command"

It's not the pkg command that is "the problem", the problem is "how do I do this in whatever shell I'm running.
You're asking for csh to understand sh syntax and sh to understand csh syntax.
 
Back
Top