Joël Bleuse on Tue, 10 Jan 2023 10:05:49 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Programmatically obtain a complete list of commands and keywords for updating the PARI/GP third-party IDE tools.



Le 10/01/2023 à 09:20, Hongyi Zhao a écrit :

Strangely, if I combine the above two sed commands into a single sed
call, the last line will be blank in the output:

werner@X10DAi:~$ echo '?*' | gp -fq | grep -v 'type RETURN' | sed -Ee
's/[ ]+/\n/g;/^$/d' | tail | cat -A
znconreychar$
znconreyconductor$
znconreyexp$
znconreylog$
zncoppersmith$
znlog$
znorder$
znprimroot$
znstar$
$
werner@X10DAi:~$

Best,
Zhao

This avoids to  create an unwanted additional line, and does the job, with no grep call:

echo '?*' | gp -fq | sed -E '/^$/d;/RETURN/d;s/ +(\w)/\n\1/g' > gpfunctions