Subject: Re: [ast-users] [ksh93] interactive ksh always exits 0 on CTRL-D
Not a big problem but I think it better exit $?.
I tried the following and it did not exit 0.
$ ksh
$ false
^D
$ print $?
1
David Korn
d...@research.att.com
Do we need some specific ksh version to
With my ksh93 Version JM 93t+ 2010-03-05 I get what you expect
$ typeset -i16 HEX=16#ff
$ print $HEX
16#
Date: Thu, 28 Feb 2013 18:43:52 -0800
From: patgeis...@gmail.com
To: ast-users@lists.research.att.com
Subject:
I'm very sorry for this. This is what I got for trusting that Linkedin
only contacts people with existing Linkedin profiles.
Your experience can be summarized...
Abandon all hope, ye who enter here. [Dante]
Ced
Hi, here x.val is assigned after the constructor has already run. It
should
be assigned before so it's accessiable to the create:
typeset -T X=( integer val
function create { ((_.val++)) })
X x=(val=5) print -v x.val # should print 6
ksh93 currently
Does ksh have an API to edit a file at a specific position pos1, read
n1 bytes, and write n1 bytes at that position without truncating the
file? I need this to do edit a file in place without reading and
writing it completely each time.
Yes, ksh has seek redirection operators.
[snip]
From: tina.harriott.mathemat...@gmail.com
On 29 July 2013 14:40, David Korn d...@research.att.com wrote:
cc: tina.harriott.mathemat...@gmail.com
Subject: Re: [ast-users] Passing a file descriptor to a child process?
ksh93 uses O_CLOEXEC to avoid passing all its file
Go strictly from left to right.
How do you assign something that hasn't been evaluated yet? Evaluating the
expression on the RHS is an absolute prerequisite to evaluating the
assignment
itself. (x += x) = 1 is nonsense. It evaluates to 0 = 1.
It makes sense, depending on the
Oops. Should have been...
(x += x) = 1 is nonsense. It evaluates to 0 = 1.
It makes sense, depending on the language. With LVALUE=RVALUE and
LVALUE+=LVALUE, where the result is an LVALUE, consider it evaluated as
LVALUE+=RVALUE
(ref(x) = deref(x)+deref(x)) = 1
(Try your
I understand the OP considering that clumsy. And something being defined
by POSIX doesn't prevent it being clumsy or not defined in an optimal way;
sometimes even the opposite is true. But I'd rather like to abstain from such
flame-prone valuations and consider the given application.
@Axel: I'm
Probably not as compact as you'd wish...
$ x=( 1 2 3 4 5 6 7 8 9 10 )
$ echo $(( $( printf +%d ${x[@]} ) ))
55
From: joshua.tay...@sub-verses.org
Date: Fri, 13 Dec 2013 14:53:24 +0100
To: ast-users@lists.research.att.com
Subject: [ast-users] operations on an entire array
I was wondering
Can you exclude any character from your input data to be used as a separator?
Then you could redefine the read separator (in the example below I used X):
printf \n\n\n\n\n | IFS= read -dX FOO
Date: Mon, 16 Dec 2013 21:02:01 +
From: eschulm...@bloomberg.net
To:
Interested in the behaviour I tried that with my version (Version JM 93t+
2010-03-05( and it gives the same result.
Moreover I noticed that in
integerb=$((2**32)) ; for ((i=0;i=97;i++)) ; do printf %5d\t%12d\n $i
$(( b i )) ; done
typeset -i b=$((2**32)) ; for ((i=0;i=97;i++)) ; do printf
Subject: Configuring what goes into the history file.
Yes, Ed, probably (I haven't checked bash). And I think zsh has something as
well.
But I am specifically asking for ksh, since that is the shell I mostly use.
So I suppose there's no such feature in ksh? (And hardly a workaround, I guess.)
Omitting immediate duplicates as default seems reasonable to me.
It would be simple, and need no additional external controls. Nice.
Defining the beaviour through some means (env var or something)
would allow more control variants; like omitting duplicates even if
not adjacent in the file - the
From: iszczesn...@gmail.com
To: janis_papanag...@hotmail.com
CC: ast-us...@research.att.com; glenn.s.fow...@gmail.com
On Sat, Apr 5, 2014 at 12:24 PM, Janis Papanagnou
janis_papanag...@hotmail.com wrote:
Please note the empty output lines of commands that previously showed
output
I've just noticed something strange with real number arithmetic in ksh.
The problem:
It seems that the fractional part in a division is interpreted as integer.
$ print $(( log(2.171828) ))
0.775569209249095711
$ print $(( log(200.0) / log(2.171828) ))
ksh: log(200.0) / log(2.171828) :
To: janis_papanag...@hotmail.com; ast-users@lists.research.att.com
I suspect that this is because you are running a very old ksh93. Here is what
I get on ubuntu linux x86_63.13.0-30-generic4 release .
[...]
On Wed, Jun 25, 2014 at 3:59 PM, Janis Papanagnou
janis_papanag...@hotmail.com wrote
You are asking:
Has this already been considered and rejected for reasons of which I'm
unaware, or does it sound reasonable to others?
As far as a quick view over the linked document can show I have
got the impression that the mentioned problems arise where '--'
is not used (or not available?)
Is the error in case 4 intentional behaviour...?
# case 1 - okay
cat - EOT |
...
EOT
awk '1' ( ... ) -
# case 2 - okay
awk '1' ( ... ) - EOT
...
EOT
# case 3 - okay
awk '1' ( ... ) EOT -
...
EOT
# case 4 - error: `)' unexpected
awk '1' EOT ( ... ) -
...
EOT
# case 5 - okay
print ...
I observe a problem (see testcase below) with ksh's read -n.
(Version 93t 2008-11-04 on Cygwin).
Bash's behaviour would be what I expect.
Ksh doesn't read the second line and doesn't terminate output.
(Maybe an old bug fixed in newer versions? Or am I missing something?)
--snip--
$ cat readtest
technically implemented in the way it is. Not really
satisfying.
But thanks again. - More insights about why the given read -n behaviour
is more sensible than bash's (in this specific read -n case) is welcome.
Terrence Doyle
On 3/15/15 9:10 AM, Janis
is OTT. There’s got to be a better way…
On Mar 12, 2015, at 8:51 AM, Janis Papanagnou janis_papanag...@hotmail.com
wrote:To understand your situation...
You have already functional code?
Your code works but it has a performance problem building the PS1 prompt?
If you want something cleaner
]
On Behalf Of Janis Papanagnou
Sent: Friday, May 15, 2015 6:23 AM
To: ast-us...@research.att.com
Subject: [ast-users] Accuracy of FP arithmetics
This is a question of *how* does it ksh *right* where other tools (awk) fail.
The task was to get the number of digits in a decimal number. (N.B
It seems that ksh's printf %R is producing wrong results for negated
glob-patterns:
$ printf %R\n !(*bak)
^(.*bak)!$
$ echo $'abc\nabcbak\ndef' | grep -E '^(.*bak)!$'
...empty result...
I'm aware that a conversion of a negation glob to regexp is not trivial to
implement,
but I'd like to know:
On Saturday, June 13, 2015 06:59:21 AM Janis Papanagnou wrote:
It seems that ksh's printf %R is producing wrong results for negated
glob-patterns:
$ printf %R\n !(*bak)
^(.*bak)!$
$ echo $'abc\nabcbak\ndef' | grep -E '^(.*bak)!$'
...empty result...
[...]
Is a regex
It seems the man pages for ksh88/ksh93 vanished from kornshell.com/doc
for some time now. Is there a new location where the official documents
can be got from?
Janis
___
ast-users mailing list
ast-users@lists.research.att.com
t;bruce.li...@gmail.com>
Gesendet: Donnerstag, 27. April 2017 22:51
An: Janis Papanagnou
Cc: ast-us...@research.att.com
Betreff: Re: [ast-users] trap issue
trap ... ERR isn't recognized by NetBSD (supposedly POSIX-compliant) /bin/sh,
so any script using that won't run under that shell.
Specific
27 matches
Mail list logo