Grep the name from package.json file
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to grep name from package.json. My file looks like below. Name is in second line of the file.
{
"name": "Proje",
"version": "1.0.0",
Output should be only Proje
linux bash shell
New contributor
add a comment |Â
up vote
0
down vote
favorite
I want to grep name from package.json. My file looks like below. Name is in second line of the file.
{
"name": "Proje",
"version": "1.0.0",
Output should be only Proje
linux bash shell
New contributor
Why grep specifically? there are much more robust ways of extracting elements from json e.g.jq -r '.name' package.json
â steeldriver
44 mins ago
This method is working. Thanks a lot. But I need a shell script. Is there a accurate way to do it by using shell commands? I used this command and It shows the required output.grep -ri "name" package.json |head -n 1 | cut -c 12-16
â Janith
38 mins ago
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to grep name from package.json. My file looks like below. Name is in second line of the file.
{
"name": "Proje",
"version": "1.0.0",
Output should be only Proje
linux bash shell
New contributor
I want to grep name from package.json. My file looks like below. Name is in second line of the file.
{
"name": "Proje",
"version": "1.0.0",
Output should be only Proje
linux bash shell
linux bash shell
New contributor
New contributor
edited 2 mins ago
New contributor
asked 56 mins ago
Janith
11
11
New contributor
New contributor
Why grep specifically? there are much more robust ways of extracting elements from json e.g.jq -r '.name' package.json
â steeldriver
44 mins ago
This method is working. Thanks a lot. But I need a shell script. Is there a accurate way to do it by using shell commands? I used this command and It shows the required output.grep -ri "name" package.json |head -n 1 | cut -c 12-16
â Janith
38 mins ago
add a comment |Â
Why grep specifically? there are much more robust ways of extracting elements from json e.g.jq -r '.name' package.json
â steeldriver
44 mins ago
This method is working. Thanks a lot. But I need a shell script. Is there a accurate way to do it by using shell commands? I used this command and It shows the required output.grep -ri "name" package.json |head -n 1 | cut -c 12-16
â Janith
38 mins ago
Why grep specifically? there are much more robust ways of extracting elements from json e.g.
jq -r '.name' package.json
â steeldriver
44 mins ago
Why grep specifically? there are much more robust ways of extracting elements from json e.g.
jq -r '.name' package.json
â steeldriver
44 mins ago
This method is working. Thanks a lot. But I need a shell script. Is there a accurate way to do it by using shell commands? I used this command and It shows the required output.
grep -ri "name" package.json |head -n 1 | cut -c 12-16
â Janith
38 mins ago
This method is working. Thanks a lot. But I need a shell script. Is there a accurate way to do it by using shell commands? I used this command and It shows the required output.
grep -ri "name" package.json |head -n 1 | cut -c 12-16
â Janith
38 mins ago
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Janith is a new contributor. Be nice, and check out our Code of Conduct.
Â
draft saved
draft discarded
Janith is a new contributor. Be nice, and check out our Code of Conduct.
Janith is a new contributor. Be nice, and check out our Code of Conduct.
Janith is a new contributor. Be nice, and check out our Code of Conduct.
Â
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480481%2fgrep-the-name-from-package-json-file%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Why grep specifically? there are much more robust ways of extracting elements from json e.g.
jq -r '.name' package.json
â steeldriver
44 mins ago
This method is working. Thanks a lot. But I need a shell script. Is there a accurate way to do it by using shell commands? I used this command and It shows the required output.
grep -ri "name" package.json |head -n 1 | cut -c 12-16
â Janith
38 mins ago