Using $1 in a shell script
Hello
I have a simple rule that detects a file in a folder and runs a shell script. I'm trying to get the found file to appear in a message posted by Pushover, it works but I can't find a way to include the file in the message part.
Here's the shell script, it uses curl
Anything I place in the message key/value appears in the notification, so at the moment it shows ${args[@]}, it's not correct and I have tried \\$1 and many other variations but am unable to get the file being processed.
Any help would be appreciated. Thanks.
I have a simple rule that detects a file in a folder and runs a shell script. I'm trying to get the found file to appear in a message posted by Pushover, it works but I can't find a way to include the file in the message part.
Here's the shell script, it uses curl
- Code: Select all
## Request
curl -X "POST" "https://api.pushover.net/1/messages.json" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"token": "afgywqjuxxxxxxxxxxxxxxja23xc",
"user": "usiwxxxxxxxxxxxhihdm25",
"message": "\\${args[@]}"
}'
Anything I place in the message key/value appears in the notification, so at the moment it shows ${args[@]}, it's not correct and I have tried \\$1 and many other variations but am unable to get the file being processed.
Any help would be appreciated. Thanks.