Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Passing Parameter in SED command Post 302203235 by robotronic on Saturday 7th of June 2008 05:46:33 AM
Old 06-07-2008
You need to use double quotes. By the way, you can also avoid cat command and avoid escaping all slashes, providing a sed "delimiter" other than "/" (in my example I've used "!"):

Code:
NEW_URL="http://abc.def.com/xyz.dtd"

sed "s!http://[^ ]*dtd!${NEW_URL}!" dir/filename1 > dir/newfile.xml

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk/sed Command : Parse parameter file / send the lines to the ksh export command

Sorry for the duplicate thread this one is similar to the one in https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121 Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
4 Replies

2. Shell Programming and Scripting

AT command parameter passing to php file

I have a bash script which utilizes a random function and then runs a file at now plus a random time. The problem is, that the php file requires a parameter after it eg: phpfile.php?code=123245b3 When i put in the file including the full path, with the at command, it will run, but not with... (1 Reply)
Discussion started by: thruxmore
1 Replies

3. Shell Programming and Scripting

Passing in regular expression as a parameter to sed

Hi All, Im using Bash. I have a pipe delimited config file which contains 3 columns, 1st column = location of a file to be chnaged 2 column = expression to find within file 3rd column = string to replace. A script will loop through the contetnts of this file and apply the changes using... (2 Replies)
Discussion started by: satnamx
2 Replies

4. UNIX and Linux Applications

Passing date parameter on Kshell command line

I need to execute a .ksh from command line. The ksh calls a control file and has 3 parameters. First parameter is a csv file, second the target table in oracle and third parameter is a date parameter. I am attempting the below from the ksh command line {code} => testfile.ksh filname.csv... (1 Reply)
Discussion started by: kobe24
1 Replies

5. Shell Programming and Scripting

Passing parameter in sed or awk commands to print for the specific line in a file

Hi, I am trying to print a specific line in a file through sed or awk. The line number will be passed as a parameter from the previous step. My code looks as below. TEMP3=`sed -n '$TEMP2p' $FILEPATH/Log.txt` $TEMP2, I am getting from the previous step which is a numerical value(eg:3). ... (2 Replies)
Discussion started by: satyasrin82
2 Replies

6. UNIX for Dummies Questions & Answers

Passing a Unix parameter to SQLPlus login command

hi All, i m trying to pass a user choice paramter from unix to sqlplus connect command here i want the user to enter the username and password he wants to connect in sql plus through read in unix and then automatically connect to that instance. sqlplus -s $1/$2 where $ 1 and $2 will b... (2 Replies)
Discussion started by: Jcpratap
2 Replies

7. Shell Programming and Scripting

Passing parameter to script, and split the parameter

i am passing input parameter 'one_two' to the script , the script output should display the result as below one_1two one_2two one_3two if then echo " Usage : <$0> <DATABASE> " exit 0 else for DB in 1 2 3 do DBname=`$DATABASE | awk -F "_" '{print $1_${DB}_$2}` done fi (5 Replies)
Discussion started by: only4satish
5 Replies

8. Shell Programming and Scripting

Passing parameter to awk command

Hi, I have a situation where I need to create a SQL statement using Unix script for each value in first field (ID). The file looks like this. Id,TARGET_FIELD_NAME,SOURCE_FIELD_NAME 1,Test_Rate,Field1 1,Test_Factor,Field2 1,Test_Size,Field3 2,Test_Rate,Field4 2,Test_Factor,Field5... (3 Replies)
Discussion started by: kiranredz
3 Replies

9. Shell Programming and Scripting

Passing command as a function parameter

Hi All, Just trying to implement the below shell script using AIX ksh shell. myfunc { eval "$*" } CMD='ls -la /etc/hosts | awk '{print $9"|"$5}'' myfunc $CMD Keeping getting "|}: not found" errors, any pointers would greatly be appreciated. Kind Regards Ed Please... (2 Replies)
Discussion started by: eo29
2 Replies

10. UNIX for Dummies Questions & Answers

Passing shell script parameter value to awk command in side the script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff |... (1 Reply)
Discussion started by: Sarita Behera
1 Replies
trang(1)						      General Commands Manual							  trang(1)

NAME
trang - convert between different schema languages for XML SYNOPSIS
trang [-I rng|rnc|dtd|xml] [-O rng|rnc|dtd|xsd] [-i input-param] [-o output-param] input-file ... output-file DESCRIPTION
trang takes as input a schema written in any of the following formats: RELAX NG (XML syntax) RELAX NG (compact syntax) XML 1.0 DTD and produces as output a schema written in any of the following formats: RELAX NG (XML syntax) RELAX NG (compact syntax) XML 1.0 DTD W3C XML Schema Trang can also infer a schema from one or more example XML documents. Trang uses an internal representation based on RELAX NG. For each supported input format, there is an input module that converts a schema in that input format into this internal representation. For each supported output format, there is an output module that converts the internal representation into a schema in that output format. Thus, any supported input format can be translated to any supported output format. Trang requires two command-line arguments: the first is the URI or filename of the schema to be translated; the second is the output file- name. Trang infers the input and output modules to be used from the extension of input and output filenames as follows: .rng RELAX NG (XML syntax) .rnc RELAX NG (compact syntax) .dtd XML 1.0 DTD .xsd W3C XML Schema .xml XML documents (used as examples from which to infer a schema) This inference can be overridden using the -I and -O options. When the input is XML documents used as examples to infer a schema, more than one input file may be specified as arguments. All the input files are specified before the output file. OPTIONS
-I rng|rnc|dtd|xml Specifies which input module to use. -O rng|rnc|dtd|xsd Specifies which output module to use. -i input-param -o output-param Specifies a parameter for an input (-i) or output (-o) module. The -i and -o options may be used multiple times in order to specify multiple parameters. There are two kinds of parameter: boolean parameters and string-valued parameters. A string-valued parameter is specified using the form name=value. A boolean parameter is specified using the form name or no-name. The applicable parameters depend on the particular input and output module. For details, see the HTML documentation. SEE ALSO
jing(1) Trang Manual http://relaxng.org AUTHOR
James Clark (jjc@jclark.com) This product includes software developed by the Apache Software Foundation (http://www.apache.org/). @VERSION@ trang(1)
All times are GMT -4. The time now is 10:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy