Hi I have a CommonTemplateStop.template file . Inside the file i need to replace the variables DepName and CompInsName with the values(Trade and TradeIns) specified in the script. I have written the below .sh script in linux server which will read the .template file and has to replace the 2 parameters DepName and CompInsName with the values specified in the script .When i call the script below i get the below error:
Am quite a novice in unix scripting. Any help is appreciated.
hi,
i want to create a script that will search and replace the values inside a particular file. i have 5 files that i need to change some values inside and i don't want to use vi to edit these files. All the inputted values on the script below will be passed into the files.
cho ""
echo... (3 Replies)
I wish to replace values of specific parameters in an input file for batch runs of a java code. It's essentially a nested for-loop sorta like this:
valuearray1 contains values for param1
valuearray2 contains values for param2
for (all values in valuearray1)
go into specific position in... (2 Replies)
Hi,
I have a folder which contains multiple config.xml files and one input file, Please see the below format.
Config Files format looks like :-
Code:
<application name="SAMPLE-ARCHIVE">
<NVPairs name="Global Variables">
<NameValuePair>
... (0 Replies)
I have a file (DCN.txt) that has about 35000 lines. It looks like:
10004470028
10005470984
10006470301
10007474812
....
I have several other files (a11.txt, a12.txt, a12_1.txt, a13.txt, etc. about 70, each 100 mb large) that have history records like so:
LINE 10005470984 01/06/2010... (13 Replies)
Hi
i am running a issue with the way i handel open file in perl
i have the following input file <File1>
D33963|BNS Default Swap|-261564.923909249|
D24484|BNS Default Swap|-53356.6868058492|
D24485|BNS Default Swap|-21180.9904679111|
D33965|BNS Default Swap|154181.478745804|... (6 Replies)
Hi,
I have a file which got only one column and got some keywords. I have another file where the keywords used in the first file are repeated in the second file.
Now I would like to know how many times each keyword from the first file is repeated in the second file.
Request your help on... (1 Reply)
Hi all.
I have the following command that is successfully searching for any one of the strings on all lines of a file and replacing it with the instructed value.
cat inputFile | awk '{gsub(/aaa|bbb|ccc|ddd/,"1234")}1' > outputFile
This does in fact replace any occurrence of aaa, bbb,... (2 Replies)
I have a environment property file which contains:
Input file:
value1 = url1
value2 = url2
value3 = url3 and so on.
I need to search all *.xml files under directory for value1 and replace it with url1.
Same thing I have to do for all values mentioned in input file. I need script in unix bash... (7 Replies)
Hi Team,
I am new to unix, please help me in this.
I have a file named properties.
The content of the file is :
##Mobile props
east.url=https://qa.east.corp.com/prop/end
west.url=https://qa.west.corp.com/prop/end
south.url=https://qa.south.corp.com/prop/end... (2 Replies)
In the below bash a file is downloaded when the program is opened and then that file is searched based on user input and the result is written to a new file.
For example, the bash is opened and the download.txt is downloaded, the user then enters the id (NA04520). The id is used to search... (5 Replies)
Discussion started by: cmccabe
5 Replies
LEARN ABOUT REDHAT
mktemp
MKTEMP(3) Linux Programmer's Manual MKTEMP(3)NAME
mktemp - make a unique temporary file name
SYNOPSIS
#include <stdlib.h>
char *mktemp(char *template);
DESCRIPTION
The mktemp() function generates a unique temporary file name from template. The last six characters of template must be XXXXXX and these
are replaced with a string that makes the filename unique. Since it will be modified, template must not be a string constant, but should be
declared as a character array.
RETURN VALUE
The mktemp() function returns NULL on error (template did not end in XXXXXX) and template otherwise. If the call was successful, the last
six bytes of template will have been modified in such a way that the resulting name is unique (does not exist already). If the call was
unsuccessful, template is made an empty string.
ERRORS
EINVAL The last six characters of template were not XXXXXX.
CONFORMING TO
BSD 4.3. POSIX dictates tmpnam(3).
NOTE
The prototype is in <unistd.h> for libc4, libc5, glibc1; glibc2 follows the Single Unix Specification and has the prototype in <stdlib.h>.
BUGS
Never use mktemp(). Some implementations follow BSD 4.3 and replace XXXXXX by the current process id and a single letter, so that at most
26 different names can be returned. Since on the one hand the names are easy to guess, and on the other hand there is a race between test-
ing whether the name exists and opening the file, every use of mktemp() is a security risk. The race is avoided by mkstemp(3).
SEE ALSO mkstemp(3), tempnam(3), tmpfile(3), tmpnam(3)GNU 1993-04-03 MKTEMP(3)