Page 1 of 1

Pass hazel filename to curl in Bash

PostPosted: Thu Jun 09, 2022 7:04 am
by restos
Hello,

I'm trying to pass the Hazel filename to a simple shell script with a curl request. I can't get the hazel filename correctly.

My script is the following:

Code: Select all
curl POST "http://myurl.com?file={$1}"


Which is the correct way to pass the $1 on this kind of requests?

Thank you very much.

Re: Pass hazel filename to curl in Bash

PostPosted: Thu Jun 09, 2022 8:21 am
by Mr_Noodle
$1 should be the full path, not just the filename so you'll need to extract the filename. There are several ways to do this in bash so google around for them.