Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function to strip quotes from a string #106

Closed
vishvananda opened this issue Apr 23, 2013 · 6 comments
Closed

Function to strip quotes from a string #106

vishvananda opened this issue Apr 23, 2013 · 6 comments
Labels

Comments

@vishvananda
Copy link

When getting output from json apis and attempting to use them with other unix utilities, you often need just the value of a string without the surrounding quotes. Clearly i can do something like:

curl ... | jq .keypairs[$i].keypair.name | tr -d '"'

but it would be nice to be able to do:

curl ... | jq '.keypairs[$i].keypair.name | tovalue'

or something along those lines

@vishvananda
Copy link
Author

alternatively it could be a comand line switch to print strings without quotes:

curl ... | jq -z .keypairs[$i].keypair.name

@ghost
Copy link

ghost commented Apr 23, 2013

--raw-output / -r http://stedolan.github.io/jq/manual/#Invokingjq

@vishvananda
Copy link
Author

ah thanks didn't see that one

@Ripounet
Copy link

Great, thanks ghost

@dtolnay dtolnay changed the title Feature Request: Function to strip quotes from a string Function to strip quotes from a string Jul 27, 2015
@StefanScherer
Copy link

Thanks @ghost !

@CanadianJeff
Copy link

awesome this helped me too thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants