vapier / pcalc

command line util for doing hex/dec/oct/bin math quickly

Home Page:https://vapier.github.io/pcalc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Binary shift operators don't work

jclsn opened this issue · comments

commented

When I type

$ pcalc 20 < 1
bash: no such file or directory: 1

and

$ pcalc 20 << 1
heredoc> 

Is this a bug or is the syntax wrong?

could it be a bash issue since the character "<" and the string "<<" are reserved for putting a file to stdin and for heredocs respectively?

A way to do it is to pass it as a string like so:

pcalc "20 << 3"

In this way the string is perceived as a single parameter instead of a bash redirect/heredoc

yes, that error is from the shell. you need to quote the arguments

commented

Ah yeah thanks