Results 1 to 5 of 5
Hi every Body,
I have a file like this
This software has been provided pursuant to a License Agreement
* containing restrictions on its use. This software contains
* valuable ...
- 04-16-2008 #1Linux Newbie
- Join Date
- Oct 2006
- Posts
- 107
how to replace Word with new word
Hi every Body,
I have a file like this
This software has been provided pursuant to a License Agreement
* containing restrictions on its use. This software contains
* valuable trade secrets and proprietary information of
* Macrovision Corporation and is protected by law. It may
* not be copied or distributed in any form or medium, disclosed
* to third parties, reverse engineered or used in any manner not
* provided for in said License Agreement except with the prior
* written authorization from Macrovision Corporation.
************************************************** ****************************
*
* Description: Used to generate lm_new.o/.obj and by license-
* generators.
*
* Once the kit is "built" (using make or nmake) this file is no longer
* needed, but should be stored somewhere safe.
*
* Set the following values:
* VENDOR_KEY1-5 Provided by Macrovision Corporation.
* VENDOR_NAME If not evaluating, set to vendor name.
* LM_SEED1-3 Make up 3 32-bit numbers, (or use
* 'lmrand1 -seed' to make up), keep secret, safe,
* and never change.
* TRL_KEY1-2 Provided by Macrovision if TRL used.
* LM_STRENGTH: If using TRL, set to desired length
*
* Upgrading: from version older than 8.1: Copy your
* ENCRYPTION_SEEDs from the old lm_code.h file.
* Make sure LM_STRENGTH matches, if you were
* using LM_STRENGTH
*/
#ifndef LM_CODE_H
#define LM_CODE_H
#include "cvd_lm_code.h"
#include "lm_trl.h"
/*
* Vendor keys: Enter keys received from Macrovision.
* Changing keys has NO impact on license files
* (unlike LM_SEEDs).
*/
#define VENDOR_KEY1 0x0
#define VENDOR_KEY2 0x0
#define VENDOR_KEY3 0x0
#define VENDOR_KEY4 0x0
#define VENDOR_KEY5 0x0
/*
* Vendor name. Leave "demo" if evaluating. Otherwise,
* set to your vendor daemon name.
*/
#define VENDOR_NAME "qavend1"
/*
* Private SEEDs: Make up 3, 8-hex-char numbers, replace and
I want to replace the VENDOR_KEY1 value only with new value , how do i change the VENDOR_KEY1 , (NOTE :it will not impact the other VENDOR KEYS)
Pls Can anybody help me out
THanks in Advance
- 04-16-2008 #2Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
According to the comment in the header of the file, you are not allowed to redistribute that code unless you got permission from the owner. And that's what you are just doing here.
I don't know what do you expect. If you want to change the value, then change it. It's the number in hex format after "VENDOR_KEY1" on the #include line. We don't own that source code, so we can't even start to think what values would have any meaning at all, though.
The question is way too vague and imprecise.
- 04-16-2008 #3Linux Newbie
- Join Date
- Oct 2006
- Posts
- 107
Replacing the word in a file
Hi ,
Actually , the format is like this in a file
#define VENDOR_KEY1 0x0
here some data is there
#define VENDOR_KEY2 0x0
here also some data are
#define VENDOR_KEY3 0x0
#define VENDOR_KEY4 0x0
#define VENDOR_KEY5 0x0
So , i want to replace the "0x0" value of "VENDOR_KEY1" to some 0x123456.
My problem is , if i use "sed" , matching pattern as a "0x0" , it is replacing all "VENDOR_KEYS" . But i need to change only the first line.
Pls help me out....
- 04-16-2008 #4Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
Now it's clearer what you intend to do.
If you have this into a file called a.txt
This command will do that:#define VENDOR_KEY1 0x0
here some data is there
#define VENDOR_KEY2 0x0
here also some data are
#define VENDOR_KEY3 0x0
#define VENDOR_KEY4 0x0
#define VENDOR_KEY5 0x0
You can then use redirection to save the new output as another file or whatever.Code:sed -e 's/VENDOR_KEY1 0x0/VENDOR_KEY1 0xffffffff/' a.txt
- 04-19-2008 #5Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Or even:
Code:sed '/VENDOR_KEY1 /s/0x0/0xffffffff/' a.txt


Reply With Quote
