Coder Social home page Coder Social logo

Comments (7)

alexanderepstein avatar alexanderepstein commented on June 15, 2024

Can you try doing a manual git install of bash snippets without checking out to the latest stable release? Steps for this process are in the readme and just skip the step with the command git checkout. There have been some changes to the currency script and I want to see if the error still occurs on the latest version. Doing the above process will get you the latest unreleased changes of bash-snippets.

If that does not work can you try running the command bash -x currency EUR USD 12.35 and paste the output here?

from bash-snippets.

cryptCEE avatar cryptCEE commented on June 15, 2024

can you try running the command bash -x currency EUR USD 12.35 and paste the output here?

before manual git install, bash -x currency EUR USD 12.35 gives me:

bash -x currency EUR USD 12.35
+ unset base
+ unset exchangeTo
+ currentVersion=1.22.1
+ unset configuredClient
+ currencyCodes=(AUD BGN BRL CAD CHF CNY CZK DKK EUR GBP HKD HRK HUF IDR ILS INR JPY KRW MXN MYR NOK NZD PHP PLN RON RUB SEK SGD THB TRY USD ZAR)
+ getConfiguredClient
+ command -v curl
+ configuredClient=curl
+ getopts uvh opt
+ [[ 3 == 0 ]]
+ [[ 3 == \1 ]]
+ [[ 3 == \2 ]]
+ [[ 3 == \3 ]]
+ checkInternet
+ httpGet github.com
+ checkBase EUR
+ base=EUR
++ echo EUR
++ tr /a-z/ /A-Z/
+ base=EUR
++ checkValidCurrency EUR
+++ echo EUR
+++ tr -d '[:space:]'
++ [[ AUD BGN BRL CAD CHF CNY CZK DKK EUR GBP HKD HRK HUF IDR ILS INR JPY KRW MXN MYR NOK NZD PHP PLN RON RUB SEK SGD THB TRY USD ZAR == *\E\U\R* ]]
++ echo 0
+ [[ 0 == \1 ]]
+ checkExchangeTo USD
+ exchangeTo=USD
++ echo USD
++ tr /a-z/ /A-Z/
+ exchangeTo=USD
++ checkValidCurrency USD
+++ echo USD
+++ tr -d '[:space:]'
++ [[ AUD BGN BRL CAD CHF CNY CZK DKK EUR GBP HKD HRK HUF IDR ILS INR JPY KRW MXN MYR NOK NZD PHP PLN RON RUB SEK SGD THB TRY USD ZAR == *\U\S\D* ]]
++ echo 0
+ [[ 0 == \1 ]]
+ checkAmount 12.35
+ amount=12.35
+ [[ ! 12.35 =~ ^[0-9]+(\.[0-9]+)?$ ]]
+ convertCurrency
++ httpGet 'https://api.exchangeratesapi.io/latest?base=EUR'
++ case "$configuredClient" in
++ curl -A curl -s 'https://api.exchangeratesapi.io/latest?base=EUR'
++ grep -Eo 'USD":[1-9.]*'
++ grep -Eo '[0-9.]*'
+ exchangeRate=
+ command -v bc
++ echo ' * 12.35'
++ bc
(standard_in) 1: parse error
+ exchangeAmount=
+ cat
=========================
| EUR to USD
| Rate:
| EUR: 12.35
| USD:
=========================
+ exit 0

from bash-snippets.

cryptCEE avatar cryptCEE commented on June 15, 2024

Can you try doing a manual git install of bash snippets without checking out to the latest stable release? Steps for this process are in the readme and just skip the step with the command git checkout. There have been some changes to the currency script and I want to see if the error still occurs on the latest version. Doing the above process will get you the latest unreleased changes of bash-snippets.

Did as advised, after manual git install error still occurs:

currency USD EUR 12.35
(standard_in) 1: parse error
=========================
| USD to EUR
| Rate:
| USD: 12.35
| EUR:
=========================

from bash-snippets.

cryptCEE avatar cryptCEE commented on June 15, 2024

after doing manual git install as advised, bash -x currency EUR USD 12.35 gives me:

bash -x currency EUR USD 12.35
+ unset base
+ unset exchangeTo
+ currentVersion=1.22.1
+ unset configuredClient
+ currencyCodes=(AUD BGN BRL CAD CHF CNY CZK DKK EUR GBP HKD HRK HUF IDR ILS INR JPY KRW MXN MYR NOK NZD PHP PLN RON RUB SEK SGD THB TRY USD ZAR)
+ getConfiguredClient
+ command -v curl
+ configuredClient=curl
+ getopts uvh opt
+ [[ 3 == 0 ]]
+ [[ 3 == \1 ]]
+ [[ 3 == \2 ]]
+ [[ 3 == \3 ]]
+ checkInternet
+ httpGet github.com
+ checkBase EUR
+ base=EUR
++ echo EUR
++ tr /a-z/ /A-Z/
+ base=EUR
++ checkValidCurrency EUR
+++ echo EUR
+++ tr -d '[:space:]'
++ [[ AUD BGN BRL CAD CHF CNY CZK DKK EUR GBP HKD HRK HUF IDR ILS INR JPY KRW MXN MYR NOK NZD PHP PLN RON RUB SEK SGD THB TRY USD ZAR == *\E\U\R* ]]
++ echo 0
+ [[ 0 == \1 ]]
+ checkExchangeTo USD
+ exchangeTo=USD
++ echo USD
++ tr /a-z/ /A-Z/
+ exchangeTo=USD
++ checkValidCurrency USD
+++ echo USD
+++ tr -d '[:space:]'
++ [[ AUD BGN BRL CAD CHF CNY CZK DKK EUR GBP HKD HRK HUF IDR ILS INR JPY KRW MXN MYR NOK NZD PHP PLN RON RUB SEK SGD THB TRY USD ZAR == *\U\S\D* ]]
++ echo 0
+ [[ 0 == \1 ]]
+ checkAmount 12.35
+ amount=12.35
+ [[ ! 12.35 =~ ^[0-9]+(\.[0-9]+)?$ ]]
+ convertCurrency
++ grep -Eo 'USD":[1-9.]*'
++ httpGet 'https://api.exchangeratesapi.io/latest?base=EUR'
++ case "$configuredClient" in
++ curl -A curl -s 'https://api.exchangeratesapi.io/latest?base=EUR'
++ grep -Eo '[0-9.]*'
+ exchangeRate=
+ command -v bc
++ echo ' * 12.35'
++ bc
(standard_in) 1: parse error
+ exchangeAmount=
+ cat
=========================
| EUR to USD
| Rate:
| EUR: 12.35
| USD:
=========================
+ exit 0

from bash-snippets.

alexanderepstein avatar alexanderepstein commented on June 15, 2024

It appears either that the API call is not working anymore, or they have changed the response format so we aren't parsing it correctly anymore. Will look into this

from bash-snippets.

stale avatar stale commented on June 15, 2024

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.

from bash-snippets.

stale avatar stale commented on June 15, 2024

This issue has been automatically closed because it has been inactive for 30 days.

from bash-snippets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.