Sponsored Content
Full Discussion: Help With Json Code
Top Forums Shell Programming and Scripting Help With Json Code Post 302986886 by Siddheshk on Thursday 1st of December 2016 10:02:04 AM
Old 12-01-2016
Hi,

Thanks for the reply. Adding space before and after fixed one part but i want the corresponding value in double quotes. With the suggested change my script looks like this,

HTML Code:
sudo ./setupscript -u http://www.test.sid.com -f Test -l RTM-5 -e s.khavnekar@gmail.com -p 12345qwer -c US -s CA -t IRVINE -o TestCustomer -r ec2-35-164-172-109.us-west-2.compute.amazonaws.com -d magentodb -a magento -b magento123 -h magentodb.cvjxzqrkxoho.us-west-2.rds.amazonaws.com
expected output is

HTML Code:
sudo ./setupscript -u "http://www.test.sid.com" -f "Test" -l "RTM-5" -e "s.khavnekar@gmail.com" -p "12345qwer" -c "US" -s "CA" -t "IRVINE" -o "TestCustomer" -r "ec2-35-164-172-109.us-west-2.compute.amazonaws.com" -d "magentodb" -a "magento" -b "magento123" -h "magentodb.cvjxzqrkxoho.us-west-2.rds.amazonaws.com"
This is what my json code looks like now,

HTML Code:
"sudo sh /var/www/html/app/bin/setupscript \n", 
			 " -u ", {"Ref" : "URL"},
			 " -f ", {"Ref" : "FirstName"},
			 " -l ", {"Ref" : "LastName"}, 
			 " -e ", {"Ref" : "Email"}, 
			 " -p ", {"Ref" : "Password"},
			 " -c ", {"Ref" : "CountryCode"}, 
			 " -s ", {"Ref" : "StateCode"}, 
			 " -t ", {"Ref" : "City"},
			 " -o ", {"Ref" : "OrgName"}, 
			 " -r ", {"Fn::GetAtt" : [ "ElasticLoadBalancer", "DNSName" ]}, 
			 " -d ", {"Ref" : "DBName"}, 
			 " -a ", {"Ref" : "DBUser"}, 
			 " -b ", {"Ref" : "DBPassword"},
			 " -h ", { "Fn::GetAtt" : [ "DBInstance", "Endpoint.Address" ] }			
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl code-sequence of json format

Hi All , Below is the perl code. from below code want to confirm one thing that wahtever the sequence of data we are passing through json format which contains 3 tuples of different sequences Eg: ParentID,SystemID,SendingTime,Time,ClientLocation,ClientID, ... (1 Reply)
Discussion started by: aish11
1 Replies

2. Programming

Json dissect with python

hello, I'm trying to parse a json file and print out each element along with some related infos such type and value. I would like to do that in python and I found a nice support to quickly load the json file, instead I found a bit more difficult the information extraction. Example, I have... (0 Replies)
Discussion started by: Dedalus
0 Replies

3. Programming

Perl Json and Hash

Hi all, i am using the following code to that use curl to that outputs a json, i am stuck it into a hash but i canot figure out how to get just the value i need ( hostname) here is my code use warnings; use strict; use Data::Dumper qw(Dumper); ##use JSON; use JSON::XS; my $curl=... (2 Replies)
Discussion started by: ab52
2 Replies

4. Programming

Perl array / json

Hi All I have used the below code to print the dumper of a json #!/usr/bin/perl use LWP::Simple; use JSON qw( decode_json ); use Data::Dumper; use strict; use warnings; my (%list); my $trendsurl =... (5 Replies)
Discussion started by: ab52
5 Replies

5. Shell Programming and Scripting

Convert json to xml

Hello everyone, I have created a workflow that will pull down data via a RESTful API in JSON, then my code parses and modifies said data. The problem I have is that these APIs I am working with only accept XML to PUT/POST data, and I am looking for an easy way to convert my JSON file to XML. ... (2 Replies)
Discussion started by: Zaphod_B
2 Replies

6. Shell Programming and Scripting

JSON Output format

Dear friends, I'm getting below API result and i would like to format them with Shell scripting. Input "id": 9, "description": "short desc", "name": "test", "name_with_namespace": "ABCD-PDFF-PLATFORM-TEST-V1 / test", "path": "test", "path_with_namespace":... (7 Replies)
Discussion started by: baluchen
7 Replies

7. UNIX for Beginners Questions & Answers

Parse property from json file

Hello All, Greetings.. I have a json file that I need to pase its URLs and other values. The match should start with "notifications" and output URLs and settings values. I tried with python or awk but hardly could get URLs only. Or whole URLs from full json file. Could not match... (2 Replies)
Discussion started by: 7adi
2 Replies
targetctl(8)						      System Manager's Manual						      targetctl(8)

NAME
targetctl - Save and restore configuration of kernel target DESCRIPTION
targetctl is a low-level script to save and restore the configuration of the LIO kernel target, to and from a file in json format. It is not normally meant to be used by end-users directly, but by system init frameworks, or advanced end-users who are generating the configura- tion file themselves and need a way to load the configuration without relying on the targetcli configuration shell. USAGE
targetctl must be invoked as root. Exit status will be 0 if successful, or nonzero if an error was encountered. targetctl save [config-file] Saves the current configuration of the kernel target to a file in json format. Since the file may contain cleartext passwords, the file's permissions will be set to only allow root access. If config-file is not supplied, targetctl will use the default file location, /etc/tar- get/saveconfig.json. targetctl restore [config-file] Removes any existing configuration and replaces it with the configuration described in the file. See saveconfig.json(5) for more details. If parts of the configuration could not be restored, those parts will be noted in the error output, and the rest of the configuration will still be applied. targetctl clear Removes any existing configuration from the running kernel target. targetctl --help Displays usage information. SEE ALSO
targetcli(8), targetd(8), saveconfig.json(5) FILES
/etc/target/saveconfig.json /sys/kernel/config/target AUTHOR
Written by Andy Grover <agrover@redhat.com>. Man page written by Andy Grover <agrover@redhat.com>. REPORTING BUGS
Report bugs via <targetcli-fb-devel@lists.fedorahosted.org> or <https://github.com/agrover/rtslib-fb/issues> targetctl(8)
All times are GMT -4. The time now is 06:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy