Home shell script to use cl1p.net online clipboard in linux - Error (23) Failed writing body
Reply: 0

shell script to use cl1p.net online clipboard in linux - Error (23) Failed writing body

user1321
1#
user1321 Published in July 16, 2018, 3:07 am

I am searching for a simple solution to send stdout (or a file content) from a linux host (raspi with bash) to my PC. The RaspberryPI has network/internet connection, but for security reasons it's not an option to set up SMB / FTP server on the raspi. It is anoying to send to an external FTP server all the time, using command line.

Please discuss general approaches (shell scripts for web form uploads, alternative options), and comment in particular on the scripting approach

I meanwhile tried to write a shell script...

#!/bin/bash
a='content='
b=`cat $2`
content=$a$b
curl -i -X POST https://cl1p.net/$1 -H "Content-Type: application/x-www-form-urlencoded" --data-binary "content=$content"

the script, as you see, should accept 2 command line args:

$1 ... clipboard "unique name"
$2 ... file to be sent to the clipboard)

When calling the script with the command line

$ ./sh ./bclip.sh 20171207testXX ./test.log

I expected to be able to download the content here: https://cl1p.net/20171207testXX

but when starting the script it says : not found.sh: 2: /boot/bclip.sh [... then the CURL upload output, and] (23) Failed writing body

What am I doing wrong?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.336239 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO