Replacement of variable by their content in a file
Dear all,
I have a "SQL request" in a file: that request include different "host variable" and I would like to substitute the different "host variable" by their respective content before executing the request.
For example:
The substitution seems OK but some characters in the source file are lost (for instance ";") and produce errors ...
Hello!
I'm having problems trying to extract the contents of a variable and placing it into a text file. Grateful for any help.
Been trying something along the lines of:
$variable > file.txt
or
`cat < $variable` > file.txt
As you can see I'm a newbie to this :D (2 Replies)
Hi all,
I have a problem here. I have a file and let we take the content of the file is just '32' (only a numeric value in that file). Now I need to assign this numeric value ( value in that file) to a variable. Is that possible? If so, can you plz advice me on this?
Thanks in... (4 Replies)
I may not being doing this description justice, but I'll give it a try.
I created a mailx script; there will be several messages using the same script where the only difference is the content. So I figured I'd make the content of the message a variable retrieved from a separate file. I have five... (5 Replies)
For example, I have a simple text file
note:
this a note
a simple note
a very very simple notewhen I use this command,
temp=$(cat "note.txt")then I echo temp, the result is in one line.
echo $temp
note: this a note a simple note a very very simple noteMy variable doesn't have newline.
How... (7 Replies)
Hi,
I am working on one script..I am having files in the below format
file 1 (each line is separated with : delimeter)
SPLASH:SPLASH:SVN
CIB/MCH:MCH:SVN
Now I want from file 1 that most left part of the first line will store in... (6 Replies)
Hi,
Need to replace an XML tag name contents, please provide any suggestions.
Scenario is :
<abc_def>Value_some_content</abc_def>
Expected output :
<abc:def>Value_some_content</abc:def>
We have many tag with different names & contents in a file or a string.
Please help on the... (3 Replies)
Hi,
I have a file where I want to replace the 15th field separated by comma, only on specific lines matching lots of different conditions.
I have managed to read the file line by line, within the loop my line is held in a variable called $line
I assume this will be using sed (maybe... (5 Replies)
I have a file File1 containing lines like below
apple ${FRUIT}-Color
orange ${FRUIT}-Color
banana ${FRUIT}-Color
Now, in my shell I'm reading the file like below
while read FRUIT DESC; do echo $FRUIT $DESC; done < File1
which outputs -
apple ${FRUIT}-Color
orange ${FRUIT}-Color... (3 Replies)
hi i just cant figure out how can i do this ls -lt > log.txt using $PWD
what i mean is how can i get the ls command content into a file using $PWD variable? :confused: (4 Replies)
Hi,,
I have the line below in a file:
$!VarSet |LFDSFN1| = '"E:\APC\Trials\20140705_427_Prototype Trial\Data\T4_20140705_Trial_Cycle_Data_13_T_Norm.txt" "VERSION=100 FILEEXT=\"*.txt\" FILEDESC=\"General Text\" "+""+"TITLE{SEARCH=NONE NAME=\"New Dataset\" LINE=1I want to write a script to change... (2 Replies)
Discussion started by: carlr
2 Replies
LEARN ABOUT SUNOS
inetconv
inetconv(1M) System Administration Commands inetconv(1M)NAME
inetconv - convert inetd.conf entries into smf service manifests, import them into smf repository
SYNOPSIS
inetconv -?
inetconv [-f] [-n] [-i srcfile] [-o destdir]
inetconv -e [-n] [-i srcfile]
DESCRIPTION
The inetconv utility converts a file containing records of inetd.conf(4) into smf(5) service manifests, and then import those manifests
into the smf repository. Once the inetd.conf file has been converted, the only way to change aspects of an inet service is to use the
inetadm(1M) utility.
There is a one-to-one correspondence between a service line in the input file and the manifest generated. By default, the manifests are
named using the following template:
<svcname>-<proto>.xml
The <svcname> token is replaced by the service's name and the <proto> token by the service's protocol. Any slash (/) characters that exist
in the source line for the service name or protocol are replaced with underscores (_).
The service line is recorded as a property of the converted service.
During the conversion process, if a service line is found to be malformed or to be for an internal inetd service, no manifest is generated
and that service line is skipped.
The input file is left untouched by the conversion process.
OPTIONS
The following options are supported:
-?
Display a usage message.
-e
Enable smf services which are listed in the input file.
-f
If a service manifest of the same name as the one to be generated is found in the destination directory, inetconv will overwrite that
manifest if this option is specified. Otherwise, an error message is generated and the conversion of that service is not performed.
-i srcfile
Permits the specification of an alternate input file srcfile. If this option is not specified, then the inetd.conf(4) file is used as
input.
-n
Turns off the auto-import of the manifests generated during the conversion process. Later, if you want to import a generated manifest
into the smf(5) repository, you can do so through the use of the svccfg(1M) utility.
If the -e option is specified, the -n option only displays the smf services that would be enabled.
-o
Permits the specification of an alternate destination directory destdir for the generated manifests. If this option is not specified,
then the manifests are placed in /var/svc/manifest/network/rpc, if the service is a RPC service, or /var/svc/manifest/network other-
wise.
EXAMPLES
Example 1: Generating smf Manifests from inetd.conf
The following command generates smf(5) manifests from inetd.conf(4) and places them in /var/tmp, overwriting any preexisting manifests of
the same name, and then imports them into the smf repository.
# inetconv -f -o /var/tmp
100232/10 -> /var/tmp/100232_10-rpc_udp.xml
Importing 100232_10-rpc_udp.xml ...Done
telnet -> /var/tmp/telnet-tcp6.xml
Importing telnet-tcp6.xml ...Done
Example 2: Generating Manifests from an Alternate Input File
The following command specifies a different input file and does not load the resulting manifests into the smf repository.
# inetconv -n -i /export/test/inet.svcs -o /var/tmp
100232/10 -> /var/tmp/100232_10-rpc_udp.xml
telnet -> /var/tmp/telnet-tcp6.xml
EXIT STATUS
The following exit values are returned:
0
Operation completed successfully (no errors).
1
Invalid options specified.
2
One or more service lines are malformed, and thus no manifest(s) were generated for them.
3
An error occurred importing one or more of the generated manifests.
4
A system error occurred.
FILES
/var/svc/manifest/network/{rpc}/<svcname>-<proto>.xml
default output manifest file name
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO inetadm(1M), inetd(1M), svccfg(1M), inetd.conf(4), attributes(5), smf(5)SunOS 5.10 21 Oct 2004 inetconv(1M)