Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Parse property from json file Post 303042444 by 7adi on Wednesday 25th of December 2019 03:14:59 AM
Old 12-25-2019
I tried using grep that gives me all URLs that is present in json file.


How could I stop matching to property notifications and its values?
"notifications":{{ ...... }}


Code:
grep '"notifications"' sample2.txt | grep -Eo '(https?)://[-A-Za-z0-9\+&@#/%?=~_|!.;]*[-A-Za-z0-9\+&@#/%=~_|]'

I am thinking to output all values between "notifications" and "}}" then look for URLs and settings values. Is that correct approach?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

source a property file in script give error

I have sourced a property file in my script like this to load some variables in the script Then i am able to echo all the property file values inside script but the script is not able to recognize other unix commands #!/bin/bash . build.properties mkdir build i am getting error ... (3 Replies)
Discussion started by: codeman007
3 Replies

2. Shell Programming and Scripting

perl use property file for variables

if I have a file that contains variables. How do I assign them in a script. file p=c e=g Thanks (3 Replies)
Discussion started by: 3junior
3 Replies

3. Shell Programming and Scripting

change word in a property file

Hi, I have a property file called "inspector.properties". In this property file stands the following: inspect=ON Now I want to have a shell script that when you run it, changes the ON in OFF in this property file. Is this possible with sed? Can anybody help me with this? Tnx very much. (5 Replies)
Discussion started by: thebladerunner
5 Replies

4. Shell Programming and Scripting

Report a missing property and property value mis match script.

Hi All, I have 2 properties files - one is a master templete and other one is a node specific properties file, I need to comapre these 2 properties files and make sure the node Specific properties file contains all the properties in the master temple properties file else report the missing... (5 Replies)
Discussion started by: jayka
5 Replies

5. Shell Programming and Scripting

Reading a property file through shell script???

Hi! i need a script that can read a property file. i.e., A script to read a "property" from property file. Read the property value and based on value of property, decide whether to start the some dataload activity or not. Its urngent. Can anyone help me out???:( (7 Replies)
Discussion started by: sukhdip
7 Replies

6. Shell Programming and Scripting

reading and updating property file

I have to do a read operation for a field in property file, which looks like follows: 123|xyz|datetime|count '|' is delimiter. Finally I managed to read the contents of property file using statement like cut -d"|" -f1 $PROPERTIES_FILE | tr '\n' ' ' <-- Reading first column But now I... (2 Replies)
Discussion started by: rakeshranjanscs
2 Replies

7. Shell Programming and Scripting

Property file processing in unix

Hi genius, Following is the problem. We have one templete file(input file) where some variables will be used Example: word1 word2 &{word3} word4 ${word5} word6 And also we have one property file where we define these variables Example: word3= something Word5= something Need to read... (5 Replies)
Discussion started by: gjarms
5 Replies

8. Shell Programming and Scripting

URL extraction from JSON file

I'm trying to export URLs from within a JSON file which in turn resulted from export of Mozilla-Firefox bookmarks. Its single line file with below given values from awk $ awk 'END { print NR }' bookmarks.json 1 $ awk 'END { print NF }' bookmarks.json 2706 $ awk -F, 'END { print NF }'... (6 Replies)
Discussion started by: busyboy
6 Replies

9. Shell Programming and Scripting

Bash script - cygwin (powershell?) pull from GitHub API Parse JSON

All, Have a weird issue where i need to generate a report from GitHub monthly detailing user accounts and the last time they logged in. I'm using a windows box to do this (work issued) and would like to know if anyone has any experience scripting for GitAPI using windows / cygwin / powershell?... (9 Replies)
Discussion started by: ChocoTaco
9 Replies
sysevent_bind_handle(3SYSEVENT) 										   sysevent_bind_handle(3SYSEVENT)

NAME
sysevent_bind_handle, sysevent_unbind_handle - bind or unbind subscriber handle SYNOPSIS
cc [flag...] file ... -lsysevent [library ...] #include <libsysevent.h> sysevent_handle_t *sysevent_bind_handle(void (*event_handler)(sysevent_t *ev)); void sysevent_unbind_handle(sysevent_handle_t *sysevent_hdl); ev pointer to sysevent buffer handle event_handler pointer to an event handling function sysevent_hdl pointer to a sysevent subscriber handle The sysevent_bind_handle() function allocates memory associated with a subscription handle and binds it to the caller's event_handler. The event_handler is invoked during subsequent system event notifications once a subscription has been made with sysevent_sub- scribe_event(3SYSEVENT). The system event is represented by the argument ev and is passed as an argument to the invoked event delivery function, event_handler. Additional threads are created to service communication between syseventd(1M) and the calling process and to run the event handler routine, event_handler. The sysevent_unbind_handle() function deallocates memory and other resources associated with a subscription handle and deactivates all sys- tem event notifications for the calling process. All event notifications are guaranteed to stop upon return from sysevent_unbind_handle(). The sysevent_bind_handle() function returns a valid sysevent subscriber handle if the handle is successfully allocated. Otherwise, NULL is returned and errno is set to indicate the error. The sysevent_unbind_handle() function returns no value. The sysevent_bind_handle() function will fail if: EACCES The calling process has an ID other than the privileged user. EBUSY There are no resources available. EINVAL The pointer to the function event_handler is NULL. EMFILE The process has too many open descriptors. ENOMEM There are insufficient resources to allocate the handle. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ syseventd(1M), sysevent_subscribe_event(3SYSEVENT), attributes(5) Event notifications are revoked by syseventd when the bound process dies. Event notification is suspended if a signal is caught and han- dled by the event_handler thread. Event notification is also suspended when the calling process attempts to use fork(2) or fork1(2). Event notifications might be lost during suspension periods. 12 Nov 2001 sysevent_bind_handle(3SYSEVENT)
All times are GMT -4. The time now is 12:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy