Here's a little toy:

#!/bin/sh
exec=:[:
exec $HOME/j901/bin/jconsole $0 [</dev/null
sleep=:(2!:0)@('sleep ',":)
([sleep@1)@stderr^:3'.'
stderr LF

(This is a somewhat minimal shell script which you can run from the
unix command line, which assumes that you've got jconsole installed in
your home directory so it can run that. It prints three dots to
stderr, while waiting 3 seconds.)

If you can understand why each of those lines exist here, you're money
ahead for using j scripts from the unix command line.

(But that requires understanding some subtle details of shell script
syntax -- why do those two 'exec' lines doing, for example? And, some
subtle details of J syntax -- why does this work at all in J and why
would removing or changing either of those exec lines make such a
difference?)

Briefly, though -- the first three lines need to be valid J and valid
shell script. The remaining lines only need to be valid J.

Followups which discuss the shell side of things probably belong in
the chat forum. Followups which discuss the J side of things (or the
combination), of course, still belong here.

Thanks,,

-- 
Raul

On Mon, Jan 27, 2020 at 2:39 AM bill lam <bbill....@gmail.com> wrote:
>
> J base library contains a verb stderr which is 1!:2&5
> you can try
>
> empty@stderr '.'
>
> Mon, 27 Jan 2020, jprogramming написал(а):
> > 27.01.2020 5:00, Julian Fondren:
> > >    #! /usr/bin/env ijconsole
> > >    dot =: 3 : '''.'' 1!:3 <''/proc/self/fd/1'''
> > >    hardwork =: 3 : 0
> > >      n =. 0
> > >      for_i. i.100 do.
> > >        dot''
> > >        n =. n + 2 | !!8x
> > >      end.
> > >      n
> > >    )
> > >    echo hardwork''
> > >    exit 0
> >
> > Great! Thank you!
> > I slightly modified your function:
> >
> > print =: 3 : 'y 1!:3 <''/proc/self/fd/1'''
> >
> > Is there any difference in using 1!: 2 and 1!: 3 for the screen?
> > I have not found.
> >
> > Sergey.
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to