Sponsored Content
Top Forums Shell Programming and Scripting Read a file and replace values in a script Post 302972519 by samrat dutta on Friday 6th of May 2016 09:15:29 AM
Old 05-06-2016
Hi Aia the values in property file can be comma seperated or newline entries. I am trying to be prepared for both type of entries and adjust the script accordingly.

Thank you
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Korn Shell Script - Read File & Search On Values

I am attempting to itterate through a file that has multiple lines and for each one read the entire line and use the value then to search in other files. The problem is that instead of an entire line I am getting each word in the file set as the value I am searching for. For example in File 1... (2 Replies)
Discussion started by: run_unx_novice
2 Replies

2. Shell Programming and Scripting

Read values from a file

Hi , I have a file with the following content I need the read the year and reporting from this file and store them in variables. I understand that we can read the file delimited by'=' but not sure how to extract the values correctly. Thanks in advance Regards (3 Replies)
Discussion started by: w020637
3 Replies

3. Shell Programming and Scripting

Help with script to read lines from file and count values

Hi, I need some help with a script I'm trying to write. I have a log file containing references to a number of different webservices. I wish to write a script that will list the webservices with a count as to how many times they appear in the log. An example of the log file content: ... (2 Replies)
Discussion started by: gman2010
2 Replies

4. Shell Programming and Scripting

Read record from the text file & assign those values to variables in the script

For eg: I have sample.txt file with 4 rows of record like: user1|password1 user2|password2 user3|password3 user4|password4 The username and password is sepsrated by '|' I want to get the 1st row value from the file and assign it to two different variables(username and password) in my... (1 Reply)
Discussion started by: priya001
1 Replies

5. Shell Programming and Scripting

Read values from file.

I have a config file of this format: Company= Alpha Tech From Email = AlphaTech@Alphatech.com Pass = Passowrd To Email = abc@hotmail.com Smtp=smtp.live.com:587 I want to read these values from this file and use in a command to send email. I am trying grep but it gives full line. I just... (8 Replies)
Discussion started by: kashif.live
8 Replies

6. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

7. Shell Programming and Scripting

awk file to read values from Db2 table replacing hard coded values

Hi, I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below... if (start_new_rec=="true"){ exclude_user="false"; user=toupper($6); match(user, "XXXXX."); if (RSTART ==2 ) { ... (9 Replies)
Discussion started by: asandy1234
9 Replies

8. Shell Programming and Scripting

Shell script to read little complex values

Dear All, I have attached a file. In that I want to read some of the values like 1. ExecutionTime 2. ClockTime etc. I want to read at a specified time. How can I do that? Thanks & Regards, linuxUser_ (9 Replies)
Discussion started by: linuxUser_
9 Replies

9. Shell Programming and Scripting

Perl script to read string from file#1 and find/replace in file#2

Hello Forum. I have a file called abc.sed with the following commands; s/1/one/g s/2/two/g ... I also have a second file called abc.dat and would like to substitute all occurrences of "1 with one", "2 with two", etc and create a new file called abc_new.dat sed -f abc.sed abc.dat >... (10 Replies)
Discussion started by: pchang
10 Replies

10. Shell Programming and Scripting

Script to replace a string with pattern read from a file

I have two files blocks.txt and rules.txt. In blocks.txt i have the following entries Linux1 Linux2 Linux3 ..... Linux10 In rules.txt i have the lines where a filename pattern starts like 'blk-name.*' I want to replace 'blk-name' with the names read from blocks.txt file I tried... (2 Replies)
Discussion started by: Jag02
2 Replies
di_path_prop_bytes(3DEVINFO)			       Device Information Library Functions			      di_path_prop_bytes(3DEVINFO)

NAME
di_path_prop_bytes, di_path_prop_ints, di_path_prop_int64s, di_path_prop_name, di_path_prop_strings, di_path_prop_type - access path prop- erty information SYNOPSIS
cc [ flag... ] file... -ldevinfo [ library... ] #include <libdevinfo.h> char *di_path_prop_bytes(di_path_prop_t prop); int (di_path_prop_t prop); int (di_path_prop_t prop, uchar_t **prop_data); int (di_path_prop_t prop, int **prop_data); int (di_path_prop_t prop, int64_t **prop_data); int di_path_prop_type(di_path_prop_t prop, char **prop_data); PARAMETERS
prop A handle to a property returned by di_path_prop_next(3DEVINFO). prop_data For di_path_prop_bytes(), the address of a pointer to an unsigned character. For di_path_prop_ints(), the address of a pointer to an integer. For di_path_prop_int64(), the address of a pointer to a 64-bit integer. For di_path_prop_strings(), the address of pointer to a character. DESCRIPTION
These functions access information associated with path property values and attributes such as the property name or data type. The di_path_prop_name() function returns a pointer to a string containing the name of the property. The di_path_prop_type() function returns the type of the path property. The type determines the appropriate interface to access property values. Possible property types are the same as for di_prop_type(3DEVINFO), excluding DI_PROP_TYPE_UNKNOWN and DI_PROP_UNDEFINED. Thus, di_path_prop_type() can return one of the following constants: DI_PROP_TYPE_INT Use di_path_prop_ints() to access property data. DI_PROP_TYPE_INT64 Use di_path_prop_int64s() to access property data. DI_PROP_TYPE_STRING Use di_path_prop_strings() to access property data. DI_PROP_TYPE_BYTE Use di_path_prop_bytes() to access property data. The di_path_prop_bytes() function returns the property data as a series of unsigned characters. The di_path_prop_ints() function returns the property data as a series of integers. The di_path_prop_int64s() function returns the property data as a series of integers. The di_path_prop_strings() function returns the property data as a concatenation of null-terminated strings. RETURN VALUES
Upon successful completion, di_path_prop_bytes(), di_path_prop_ints(), di_path_prop_int64s(), and di_path_prop_strings() return a non-neg- ative value, indicating the number of entries in the property value buffer. If the property is found, the number of entries in prop_data is returned. Otherwise, -1 is returned and errno is set to indicate the error. For di_path_prop_bytes(), the number of entries is the number of unsigned characters contained in the buffer pointed to by prop_data. For di_path_prop_ints(), the number of entries is the number of integers contained in the buffer pointed to by prop_data. For di_path_prop_ints(), the number of entries is the number of 64-bit integers contained in the buffer pointed to by prop_data. For di_path_prop_strings(), the number of entries is the number of null-terminated strings contained in the buffer. The strings are stored in a concatenated format in the buffer. The di_path_prop_name() function returns the name of the property. The di_path_prop_type() function can return one of types described in the Description. ERRORS
These functions will fail if: EINVAL One of the arguments is invalid. For example, the property type does not match the interface. ENOTSUP The snapshot contains no property information. ENXIO The path property does not exist. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
di_path_prop_next(3DEVINFO), di_prop_type(3DEVINFO), libdevinfo(3LIB), attributes(5) Writing Device Drivers SunOS 5.11 15 May 2008 di_path_prop_bytes(3DEVINFO)
All times are GMT -4. The time now is 01:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy