[bug-notifications] [pkg_get 0004825]: pkg-get can mess up shells on solaris express

Mantis Bug Tracker noreply at opencsw.org
Thu Sep 15 18:13:16 CEST 2011

The following issue has been REOPENED. 
Reported By:                bryanwgraham
Assigned To:                
Project:                    pkg_get
Issue ID:                   4825
Category:                   regular use
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Date Submitted:             2011-09-15 17:40 CEST
Last Modified:              2011-09-15 18:13 CEST
Summary:                    pkg-get can mess up shells on solaris express
While I realize that OpenCSW probably doesn't explicitly support Solaris
Express, this problem will need to be fixed eventually.  When pkg-get is
run on Solaris Express, if any of the 'print "whatever" > /dev/fd/2'
statements are processed, the shell will have difficulties when it returns.
 Specifically, backspace will print "^H" instead of actually backspacing,
and usually if something visual is run after (vim for instance) the screen
with crop oddly.

The easiest way to test this is to run "pkg-get -i blah" (something that
it won't find), then type something and try to backspace it.

There is a simple fix, because the print statement support a -u option
that does exactly what "> /dev/fd/2" does without causing the problem. 
Thus, this line

gsed -i.bak -e 's/print\(.*\)>\/dev\/fd\/2/print -u 2\1/g'

will fix the problem and create a backup pkg-get.bak file in the process. 
The following line will do it without creating a backup.

gsed -ie 's/print\(.*\)>\/dev\/fd\/2/print -u 2\1/g' /opt/csw/bin/pkg-get

For informational purposes:
SunOS mirror-x86 5.11 snv_151a i86pc i386 i86pc Solaris
GNU bash, version 4.0.28(1)-release (i386-pc-solaris2.11)

 (0009267) bryanwgraham (reporter) - 2011-09-15 18:13
I don't disagree with you, it is Solaris Express' problem, but it's such an
easy "fix" on the pkg-get side (a simple gsed line), and it IS a problem
that lots of users will experience.  I realize it's not pkg-get's problem,
but given that print even supports a switch (-u) that makes redirection
unnecessary, why wouldn't you implement it and save lots of users the

More information about the bug-notifications mailing list