Skip to content

POST/GET command not found when used in Bash script #84

Open
@benbelgium

Description

@benbelgium

Hi Micha

First of all thank you for developing resty.

I'm trying to write a bash file to automatically execute some steps, but if I execute each command in a terminal everything works fine, but in bash all my POST/GET commands fail with the message command not found....

I read up online about PATH settings that could be causing this, I read on github the examples and everything seems perfect to me, and still it's not working....

#!/bin/bash

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

source /sbin/resty 'http://abu/api'

POST /login '{"username" : "report", "password" : "XXXXXXXX"}' | jshon -e auth_token -u

I added the PATH manually just to make sure it's correct, and for security reasons I replaced the real password with XXXX
If I would execute ./checkben.sh the output would be:

./checkben.sh: line 11: POST: command not found
warning: nothing to read

If I would execute each command manually at the terminal the output would be:

djA6MDUwNzc3MzMtZjg5OC00YTdiLWI2OGQtNGUzMDgzMjg5ODVhOjM3Oi91c3IvYnAvbG9ncy5kaXIvZ3VpX3JlcG9ydC5sb2c6MA==

Which is EXACTLY what I needed, so it is working fine at the terminal prompt....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions