0x0 icon indicating copy to clipboard operation
0x0 copied to clipboard

syntax errors on running the script

Open esinkei opened this issue 3 years ago • 4 comments

/usr/local/bin/0x0: line 2: syntax error near unexpected token `newline'
/usr/local/bin/0x0: line 2: `<?xml version="1.0" encoding="utf-8"?>'

esinkei avatar Feb 01 '22 03:02 esinkei

Did you save the raw file instead of the HTML page that displays the script?

Calinou avatar Feb 01 '22 15:02 Calinou

I followed your manual installation instructions. The 0x0 script is accessible systemwide in the terminal, but it spits out the error messages.

esinkei avatar Feb 02 '22 03:02 esinkei

I can't reproduce this on Fedora 34 and curl 7.76:

❯ curl -LO https://raw.githubusercontent.com/Calinou/0x0/master/bin/0x0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2720  100  2720    0     0   8888      0 --:--:-- --:--:-- --:--:--  8888

~
❯ ./0x0                     
zsh: permission denied: ./0x0

~
❯ chmod +x 0x0                                                         

~
❯ ./0x0
0x0, a wrapper script for https://0x0.st/

  Upload a file:
      0x0 <file>

  Upload from an URL (the file won't be fetched locally):
      0x0 <url>

  Upload from standard input:
      0x0 -

The uploaded file's URL is printed to standard output when the upload is completed.

Which operating system and curl version are you using? (curl --version)

Calinou avatar Feb 02 '22 16:02 Calinou

PS: If you can't get this script to work, remember that this shell script is just a tiny wrapper. If you have curl installed, you can run:

curl -F'[email protected]' https://0x0.st

Or to upload a file from a remote URL (making 0x0.st download that file to upload it):

curl -F'url=http://example.com/image.jpg' https://0x0.st

You could create your own shell alias to require less typing.

Calinou avatar Feb 03 '22 17:02 Calinou

@esinkei Are you still getting errors when running this?

sumpygump avatar Dec 02 '22 18:12 sumpygump

Nah! Everything is fine now.

esinkei avatar Dec 10 '22 01:12 esinkei