ptpb / pb

pb is a formerly-lightweight pastebin and url shortener
Other
549 stars 52 forks source link

The shell functions for pasting are slightly incorrect. #137

Closed kitlith closed 8 years ago

kitlith commented 8 years ago

For lack of a better place to put this, your website has this (for example):

pb () { curl -F "c=@${1:--}" https://ptpb.pw/ }

where it needs to be

pb () { curl -F "c=@${1:--}" https://ptpb.pw/; }

It's very subtle, it's just missing a semicolon, but that causes it to fail.

buhman commented 8 years ago

What shell is this?

slashbeast commented 8 years ago

You need either new line or ; at the end of your function before you close it on any POSIX-compatible shell, bash, zsh, ask, ksh etc. kitling is correct.

buhman commented 8 years ago

well then

compound_list    :              term
                 | newline_list term
                 |              term separator
                 | newline_list term separator
                 ;
brace_group      : Lbrace compound_list Rbrace
                 ;

That reads like single term with no separator is completely valid. zsh deals with this correctly, but bash does not. This seems more like bash not being spec-compliant. Someone should probably file a bug.

Though I don't care about the others, I suppose the examples should be copy-pasteable in at least bash and zsh…

buhman commented 8 years ago

f5c4e7437189d6a739ae54cdc1d07fa4c08cf3fb

kitlith commented 8 years ago

Sorry, haven't been looking at Github.

Although it seems moot at this point, I will add that I was using bash on Arch Linux.