Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

property(3) [freebsd man page]

PROPERTIES(3)						   BSD Library Functions Manual 					     PROPERTIES(3)

NAME
properties_read, property_find, properties_free -- functions to allow creating simple property lists from ASCII file data LIBRARY
System Utilities Library (libutil, -lutil) SYNOPSIS
#include <libutil.h> properties properties_read(int fd); char * property_find(properties list, const char *name); void properties_free(properties list); DESCRIPTION
typedef struct _properties { struct _properties *next; char *name; char *value; } *properties; The function properties_read() reads name = value pairs from the file descriptor passed in fd and returns the head of a new property list, assuming that the file's contents have been parsed properly, or NULL in case of error. The property_find() function returns the associated value string for the property named name if found, otherwise NULL. The value returned may be up to PROPERTY_MAX_VALUE bytes in length. The properties_free() function is used to free the structure returned by properties_read() when it is no longer needed. FILE FORMAT
Each property in the file is assumed to have the format of name = value where name is an alphanumeric string (and any punctuation not includ- ing the `=' character) and value is an arbitrary string of text terminated by a newline character. If newlines are desired, the entire value should be enclosed in { } (curly-bracket) characters. Any line beginning with a # or ; character is assumed to be a comment and will be ignored. AUTHORS
Jordan Hubbard BUGS
Simplistic. BSD
October 7, 1998 BSD

Check Out this Related Man Page

PROPERTIES(3)						   BSD Library Functions Manual 					     PROPERTIES(3)

NAME
properties_read, property_find, properties_free -- functions to allow creating simple property lists from ASCII file data LIBRARY
System Utilities Library (libutil, -lutil) SYNOPSIS
#include <libutil.h> properties properties_read(int fd); char * property_find(properties list, const char *name); void properties_free(properties list); DESCRIPTION
typedef struct _properties { struct _properties *next; char *name; char *value; } *properties; The function properties_read() reads name = value pairs from the file descriptor passed in fd and returns the head of a new property list, assuming that the file's contents have been parsed properly, or NULL in case of error. The property_find() function returns the associated value string for the property named name if found, otherwise NULL. The value returned may be up to PROPERTY_MAX_VALUE bytes in length. The properties_free() function is used to free the structure returned by properties_read() when it is no longer needed. FILE FORMAT
Each property in the file is assumed to have the format of name = value where name is an alphanumeric string (and any punctuation not includ- ing the `=' character) and value is an arbitrary string of text terminated by a newline character. If newlines are desired, the entire value should be enclosed in { } (curly-bracket) characters. Any line beginning with a # or ; character is assumed to be a comment and will be ignored. AUTHORS
Jordan Hubbard BUGS
Simplistic. BSD
October 7, 1998 BSD
Man Page

13 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem printing the property of xml file via shell script

Hi, I have a config.xml which cointains the tags like <CONFIG> <PROPERTY name="port" value="1111"/> <PROPERTY name="dbname" value="ABCDE"/> <PROPERTY name="connectstring" value="xyz/pwd"/> </CONFIG> This file is in some directory at UNix box. I need to write a... (4 Replies)
Discussion started by: neeto
4 Replies

2. 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

3. Shell Programming and Scripting

URGENT: Script/Function needed to read text property files in block wise

Hi, Iam in a need for a script/function in KSH where I want to read a text file (property file) in block by block. Here is the example: Heading Name Descripton Block Block1 Value1 Description Property Name Value Property Name Value Property Name Value Property Name Value Property Name... (7 Replies)
Discussion started by: ysreenivas
7 Replies

4. Shell Programming and Scripting

Script to update Property Entry Values

Hi All, I'm Raghavendra. I have a very urgent requirement to develop a Shell Script which will allow to use variables in a property file as demonstarted below var1=UNIX var2=LINUX var3=WINDOWS var4=$var1,$var2 var5=$var3 Could you please help me to develop a shell script which can... (2 Replies)
Discussion started by: raghavstunner
2 Replies

5. Solaris

Error: prtdiag failed! property not found

Hello Everyone! I have a Sun Fire E2900. When I run a prtdiag -v, it fails to give complete information. It fails with the following error message "Prtdiag failed!Property not found". Please help. # which prtdiag /usr/sbin/prtdiag # ls -l /usr/sbin/prtdiag -r-xr-xr-x 4 root bin 512... (10 Replies)
Discussion started by: pingmeback
10 Replies

6. 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

7. 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

8. 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

9. 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

10. Shell Programming and Scripting

Reading a property file from another script

(6 Replies)
Discussion started by: SANKALP
6 Replies

11. 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

12. Shell Programming and Scripting

Not to remove Files based on property value

Hi All, Need your help to fix one script. Main agenda is: 1. Read a property file. 2. Delete all files in directory except the name from Property file. I am trying to read property file for value then deleting all files from directory except THAT value/name. I have tried so far as... (3 Replies)
Discussion started by: sukhdip
3 Replies

13. Solaris

Find highest value of a particular property in multiple files

I have multiple files with pattern of "*.tps (example:tps-20170307170421560-1053.tps)" in my log directory(files are in different sub directories). entries in files are given below. I want to extract highest value of endtime accross all files. "endTime :1488902691462" ... (7 Replies)
Discussion started by: Agoyals1986
7 Replies