Pass hazel filename to curl in Bash

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Pass hazel filename to curl in Bash 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.
restos
 
Posts: 1
Joined: Thu Jun 09, 2022 7:01 am

Re: Pass hazel filename to curl in Bash 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.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support