Sponsored Content
Top Forums Shell Programming and Scripting Take input from read and place it a string in another file Post 302592986 by svetoslav_sj on Wednesday 25th of January 2012 11:10:49 AM
Old 01-25-2012
Take input from read and place it a string in another file

Hi,
This is most likely a dumb question but I could not find answer to it elsewhere.

I'm building a simple menu with case /esac and want to read user's input:

Please enter XYZ ; read XYZ

How do I take the value of XYZ and insert it as a variable $XYZ in file file.txt ?

I may need to explain that I have existing variable IP="address" in file.txt and I need to substitute address with XYZ from the user's input

Last edited by svetoslav_sj; 01-25-2012 at 12:18 PM.. Reason: Need to clarify
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert a string in a file at specified place?

Hi all, I want to insert a string in a specified place of a very large file. I am giving an example of the task: I love football. Above is a sentence in a file and I want to insert a string "the" between love and football. It is not sure that where this particular line exists. It has to... (4 Replies)
Discussion started by: naw_deepak
4 Replies

2. Shell Programming and Scripting

Read a number from file and place it back

Hi All, I want to read one number from the file. Only one number will be there in the file. then i have to increment the number in my script and put it back in the same file. Is it possible? Can anybody help me? Thanks, Vinay (6 Replies)
Discussion started by: vinayakatj56
6 Replies

3. Programming

How i can read a long integer from standar input and a string with as many characters as specified..

how i can read a long integer from standar input and a string with as many characters as specified in the number? i thing that i must use the read command ofcourse.... (6 Replies)
Discussion started by: aintour
6 Replies

4. Shell Programming and Scripting

Read from file specific place in file using inode

Hello, I am using tcsh on AIX. I would like to write a script that does the following: 1. given an inode, how do I find exactly the name of the file? I know I could do this using ls -i | grep <inode> but it returns: <inode> <filename>. I need some string manipulation or something to... (1 Reply)
Discussion started by: lastZenMaster
1 Replies

5. UNIX for Dummies Questions & Answers

how to place input from user into a file

as the title, how can i allow a user to key in one's name, birthday and email address and save it into a specific file i have created earlier? thank you so much for any reply. (3 Replies)
Discussion started by: branred
3 Replies

6. Shell Programming and Scripting

Grep a string from input file and delete next three lines including the line contains string in xml

Hi, 1_strings file contains $ cat 1_strings /home/$USER/Src /home/Valid /home/Review$ cat myxml <projected value="some string" path="/home/$USER/Src"> <input 1/> <estimate value/> <somestring/> </projected> <few more lines > <projected value="some string" path="/home/$USER/check">... (4 Replies)
Discussion started by: greet_sed
4 Replies

7. Shell Programming and Scripting

Read input and match string

#!/bin/ksh echo DB LIST ps -ef | grep pmon | grep -v grep | awk -F_ '{print $3}' | sort db_up=`ps -ef | grep pmon | grep -v grep | awk -F_ '{print $3}' | sort` echo echo "Enter database name from the above list" echo read ORACLE_SID echo echo Database selected is: $ORACLE_SID echo ... (10 Replies)
Discussion started by: crazy_max
10 Replies

8. Shell Programming and Scripting

Utilize input file in place of argument

First I apologize for my ignorance as I am very new to the world of UNIX but love it and have a huge desire to learn it. A question I have is if a Korn script utilizes/relies on an argument to run, can you add these into a file and pipe them to the script without changing anything inside the... (2 Replies)
Discussion started by: djzah
2 Replies

9. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

10. Shell Programming and Scripting

Use while loop to read file and use ${file} for both filename input into awk and as string to print

I have files named with different prefixes. From each I want to extract the first line containing a specific string, and then print that line along with the prefix. I've tried to do this with a while loop, but instead of printing the prefix I print the first line of the file twice. Files:... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
mlib_ImageColorXYZ2RGB_Fp(3MLIB)			    mediaLib Library Functions				  mlib_ImageColorXYZ2RGB_Fp(3MLIB)

NAME
mlib_ImageColorXYZ2RGB_Fp - XYZ to RGB color conversion SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageColorXYZ2RGB_Fp(mlib_image *dst, const mlib_image *src); DESCRIPTION
The mlib_ImageColorXYZ2RGB_Fp() function performs a color space conversion from CIE XYZ to ITU-R Rec.708 RGB with D64 white point. The source and destination images must be three-channel images. It uses the following equation: |R| |cmat[0] cmat[1] cmat[2]| |X| |G| = |cmat[3] cmat[4] cmat[5]| * |Y| |B| |cmat[6] cmat[7] cmat[8]| |Z| where cmat[] = { 3.240479, -1.537150, -0.498535, -0.969256, 1.875992, 0.041566, 0.055648, -0.204043, 1.057311 }; src[x][y] = { X, Y, Z }; dst[x][y] = { R, G, B }; PARAMETERS
The function takes the following arguments: dst Pointer to destination image. src Pointer to source image. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_ImageColorConvert1(3MLIB), mlib_ImageColorConvert1_Fp(3MLIB), mlib_ImageColorRGB2XYZ(3MLIB), mlib_ImageColorRGB2XYZ_Fp(3MLIB), mlib_ImageColorRGB2YCC(3MLIB), mlib_ImageColorRGB2YCC_Fp(3MLIB), mlib_ImageColorXYZ2RGB(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_ImageColorXYZ2RGB_Fp(3MLIB)
All times are GMT -4. The time now is 10:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy