Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

If Bill Gates is the Devil then Linus Torvalds must be the Messiah. -- Unknown source


devel / comp.lang.postscript / PostScript as a unix shell tool

SubjectAuthor
o PostScript as a unix shell toolluser droog

1
PostScript as a unix shell tool

<45978d26-29b7-4a6b-9136-9287bf504aacn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=108&group=comp.lang.postscript#108

  copy link   Newsgroups: comp.lang.postscript
X-Received: by 2002:ae9:ef4b:: with SMTP id d72mr32515893qkg.690.1641234903252;
Mon, 03 Jan 2022 10:35:03 -0800 (PST)
X-Received: by 2002:a05:6808:1485:: with SMTP id e5mr37314331oiw.156.1641234902948;
Mon, 03 Jan 2022 10:35:02 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.postscript
Date: Mon, 3 Jan 2022 10:35:02 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=97.87.183.68; posting-account=G1KGwgkAAAAyw4z0LxHH0fja6wAbo7Cz
NNTP-Posting-Host: 97.87.183.68
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <45978d26-29b7-4a6b-9136-9287bf504aacn@googlegroups.com>
Subject: PostScript as a unix shell tool
From: luser.droog@gmail.com (luser droog)
Injection-Date: Mon, 03 Jan 2022 18:35:03 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 27
 by: luser droog - Mon, 3 Jan 2022 18:35 UTC

I cooked up this little example for a thread in comp.lang.forth
about "RPN languages of the future".

$ cat toolbag.ps
%!
<<
/each-line { 1 dict begin {proc src}{exch def}forall
src type /stringtype eq { /src src (r) file store } if
{ src 1024 string readline {proc}{pop exit} ifelse } loop
end }
/contains { search { pop pop pop true }{ pop false } ifelse }
/map { 1 index xcheck 3 1 roll [ 3 1 roll forall ] exch {cvx} if }
/reduce { exch dup first exch rest 3 -1 roll forall }
/first { 0 get }
/rest { 1 1 index length 1 sub getinterval }
>> begin

$ gsnd -q -dNOSAFER toolbag.ps -c '[(toolbag.ps){(a)contains{1}{0}ifelse}each-line]{add}reduce = quit'
6 $ gsnd -q -dNOSAFER toolbag.ps -c '[(toolbag.ps){(a)contains{1}if}each-line]length = quit'
6

Perhaps an

$ alias gsq='gsnd -q -dNOSAFER'

would help, too.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor