Portmaster: why this?

Code:
<root@freebsd8bx>/root # portmaster -D -PP 'cat /root/installed-port-list'      
===>>> /var/db/pkg/cat does not exist
===>>> Aborting update

Terminated
Is this a portmaster bug?
 
That's a variation of step 10 of the reinstallation procedure at the end of the portmaster man page. Look very closely at that line; those aren't single ticks.
 
Those look like single quotes around cat instead of backticks. (on the tilde key) with single quotes it will just try to portupgrade "cat" instead of inserting the output of cat /root/installed-port-list if I am not mistaken.
 
numpad5 said:
Those look like single quotes around cat instead of backticks. (on the tilde key) with single quotes it will just try to portupgrade "cat" instead of inserting the output of "cat /root/installed-port-list" if I am not mistaken.
You guys are right. So, so, sensible command line. It should accept also single quotes not just backticks. Duh to me yes (and the programmer too).
 
No, backticks have a different meaning than single quotes. Both are interpreted by the shell before portmaster ever sees them. Backticks mean "execute this and return the result", while single quotes are just "take what's given verbatim".
 
For sh-based shells (don't know about csh-based shells), it's so much nicer to use the $( ) syntax instead of backticks. For just this reason. Yeah, yeah, backticks are the historical way of doing things, and people don't like change, and $() may not be universal, but it's just so much nicer to use, read, etc. :)

$ portmaster -D -PP $(cat /root/installed-port-list)
 
Back
Top