Discussion:
[ast-developers] about the PS1 value of the compiled ksh executable
Jiaqiang Xu
2013-09-16 06:24:30 UTC
Permalink
Hello all:

After I compiled the ksh executable from the source in the cygwin
environment, I ran it and found some errors with the PS1 value:

root at ls21n06:~ $ mmksh.cygwin
mmksh.cygwin: line 1: syntax error: `|' unexpected
${|
local e=$?

(( e )) && REPLY+="$e|"
REPLY+=${USER:=$(ulimit -c 0; id -un 2>/dev/null || echo \?)}
REPLY+=@${HOSTNAME%%.*}:

local d=${PWD:-?} p=~; [[ $p = ?(*/) ]] || d=${d/#$p/~}
local m=${%d} n p=...; (( m > 0 )) || m=${#d}
(( m > (n = (COLUMNS/3 < 7 ? 7 : COLUMNS/3)) )) && d=${d:(-n)} || p=
REPLY+=$p$d

return $e
} $


I need to export PS1 to '#' value manually to avoid this error. I wonder
where in the C source code of ksh I can change to control the PS1 of the
ksh executable. Thank you very much!

Best,

Jiaqiang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20130916/56f5fe6b/attachment.html>
Glenn Fowler
2013-09-16 12:39:53 UTC
Permalink
please post the original assignment of PS1
maybe its in your .profile or $ENV file?
--===============0475043982206599680==
Content-Type: multipart/alternative; boundary=047d7bacb98ec43c9d04e67a410f
--047d7bacb98ec43c9d04e67a410f
Content-Type: text/plain; charset=ISO-8859-1
After I compiled the ksh executable from the source in the cygwin
root at ls21n06:~ $ mmksh.cygwin
mmksh.cygwin: line 1: syntax error: `|' unexpected
${|
local e=$?
(( e )) && REPLY+="$e|"
REPLY+=${USER:=$(ulimit -c 0; id -un 2>/dev/null || echo \?)}
local d=${PWD:-?} p=~; [[ $p = ?(*/) ]] || d=${d/#$p/~}
local m=${%d} n p=...; (( m > 0 )) || m=${#d}
(( m > (n = (COLUMNS/3 < 7 ? 7 : COLUMNS/3)) )) && d=${d:(-n)} || p=
REPLY+=$p$d
return $e
} $
I need to export PS1 to '#' value manually to avoid this error. I wonder
where in the C source code of ksh I can change to control the PS1 of the
ksh executable. Thank you very much!
Best,
Jiaqiang
--047d7bacb98ec43c9d04e67a410f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hello all:<div><br></div><div>After I compiled the ksh exe=
cutable from the source in the cygwin environment, I ran it and found some =
errors with the PS1 value:</div><div><br></div><div><div>root at ls21n06:~ $ m=
mksh.cygwin</div>
<div>mmksh.cygwin: line 1: syntax error: `|&#39; unexpected</div><div>${|</=
div><div>=A0 =A0 =A0 =A0 local e=3D$?</div><div><br></div><div>=A0 =A0 =A0 =
=A0 (( e )) &amp;&amp; REPLY+=3D&quot;$e|&quot;</div><div>=A0 =A0 =A0 =A0 R=
=A0 =A0 =A0 =A0 local d=3D${PWD:-?} p=3D~; [[ $p =3D ?(*/) ]] || d=3D${d/#$=
: COLUMNS/3)) )) &amp;&amp; d=3D${d:(-n)} || p=3D</div>
<div>=A0 =A0 =A0 =A0 REPLY+=3D$p$d</div><div><br></div><div>=A0 =A0 =A0 =A0=
return $e</div><div>} $</div></div><div><br></div><div><br></div><div>I ne=
ed to export PS1 to &#39;#&#39; value manually to avoid this error. =A0 I w=
onder where in the C source code of ksh I can change to control the PS1 of =
the ksh executable. Thank you very much!</div>
<div><br></div><div>Best,</div><div><br></div><div>Jiaqiang</div></div>
--047d7bacb98ec43c9d04e67a410f--
--===============0475043982206599680==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
--===============0475043982206599680==--
Continue reading on narkive:
Loading...