Closed darsh12 closed 6 years ago
What version of bash-snippets are you using? It appears you are missing the | after each echo of the response from the api, if you notice none of the variables are actually being set, which is odd. I am running the identical command on my machine and it works without any problems. I am using Linux, but this doesn't seem to be the issue although it could be
Can you take this code and place it in a file called test.sh
and run bash -x test.sh
#!/usr/bin/env bash
movieinfo=$(curl -A curl -s 'http://www.omdbapi.com/?t=Inception&apikey=946f500a')
year=$(echo $movieinfo | python -c 'import sys, json; print json.load(sys.stdin)['\''Year'\'']')
I would have uploaded the file for you but github wont allow me to upload a shell script. Post the output here. It is basically just trying the same thing but only for one of the fields.
Additionally can you run python -V
and let me know what that says?
I am assuming that you might have installed python3 through something like homebrew which might be breaking the scripts call to python. I am not sure if i can fix that for you exactly. The only fix i can offer if that is the case would be to create an alias to python2
in your ~/.bashrc (it might be called .bash_profile
on mac) by adding this line to the file
alias python="python2"
Python 2
Python 3
Sorry I haven't responded, been a little busy, it might have to do with your version of python I will look into it and get back to you
no problem...not a big deal
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has been inactive for 30 days.
I know this was closed but I noticed that this still happens with other movies.
Sometimes there is a pause in the command and then nothing happens, but if I run the same command it works.
Just felt that I had to leave in case
Sorry this was closed by a bot cause I have been busy and haven't touched it, so does this work sometimes for you then? That seems a little weird
Yeah it is. I don't get it anymore so maybe there was something up with my terminal when I ran the command.
Issue Label:
Description: Trying to run "movies Inception" but ending up getting a blank screen
bash -x movies Inception does have output
If its a bug make sure to include this section.
OS and OS version:
OS Version: 10.13.13