Skip to content

fix the bug "streaming not working"#4

Open
blululu wants to merge 7 commits intojbenet:masterfrom
blululu:master
Open

fix the bug "streaming not working"#4
blululu wants to merge 7 commits intojbenet:masterfrom
blululu:master

Conversation

@blululu
Copy link

@blululu blululu commented Nov 21, 2021

In my testing environment,when I code like

./compress-pdf 

then output:

gs is /usr/bin/gs
Awaiting pdf from stdin (stream mode)...
If you meant to compress a file, use: ./compress-pdf <file>

and I input

example.pdf

nothing happened,and I check the shell code,found the cause for this:

cat - > "$infile" # line 42

the 'cat' command is used wrongly,it capture the input constantly writing to "$infile".
'read' should be used here.
And also wrongly used in below code:

cat "$outfile"  # line 61

It is important to know 'cat' used to read and write file itself above , not the filename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant