Sponsored Content
Full Discussion: Garbled Sed w/variables
Top Forums Shell Programming and Scripting Garbled Sed w/variables Post 12665 by bergerj3 on Friday 4th of January 2002 03:41:04 PM
Old 01-04-2002
That's exactly what I was looking for. With the sed example, I found it useful to set a variable to an unprintable character first:

CA=`echo '\001'`

and then use that for my delimiter:

PARTFILEPATH=`echo $FULLFILEPATH | sed "s${CA}${STRIPDIR}${CA}${CA}"`

I'm always a little weary of using printable characters for things like this, you never know where the one you choose might show up! I did like the ksh example even better though, I hadn't even thought of that approach.

Thanks for your help!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed: command garbled

Im getting this error message when trying to substitute filepaths in a sed search and replace string #!/usr/bin/ksh ORACLE_SID=PH3 ORACLE_ADMIN=/data01/app/oracle/admin/$ORACLE_SID DATAFILE_DIR=/asterisk/oradata/$ORACLE_SID sed -e s/DBNAME/$ORACLE_SID/g < initPH2.ora | sed -e... (1 Reply)
Discussion started by: blakmk
1 Replies

2. Shell Programming and Scripting

sed: command garbled error.....

Dear friends, please give me the solution to the following query. If a file contains multiple tags of same name, then how to get the required string between the tags, in which the string begins with "W/X" i.e., file1.txt contains following text(please note that all the following tags are in... (1 Reply)
Discussion started by: swamymns
1 Replies

3. Shell Programming and Scripting

Sed: command garbled :s/

Hi, I really need some help, I am using a very basic script to proess a text file. This script has been used many times but all of a sudden all on it's own it's stopped working. The line in the script is: sed 's/ //g' $ORGFILE > $NEWFILE and the error is Sed: command garbled :s/ All... (3 Replies)
Discussion started by: heidi.lightfoot
3 Replies

4. Shell Programming and Scripting

sed: command garbled - when executed with $variables

I have got a file job_tree.lst , which contains 1 line as below $ cat job_tree.lst ABC_D_EQ_XXXXX_YYYY_PRD_UX 05/08/2009 05:47 05/08/2009 05:50 IN 13412850/0 I want to get a child job string 3 characters offset from the parent job string (i.e. ABC_D_EQ_XXXXX_YYYY_PRD_UX 05/08/2009... (4 Replies)
Discussion started by: Armaan_S
4 Replies

5. Shell Programming and Scripting

sed: command garbled

Hi, I have a file1 as : A=/home/user B=/home/user1 C=/home/user2 D=/home/aacsms E=/home/user1/temp F=/home/user1/area1 and my script as: a=`cat /home/aacsms7/file1 | grep -i e` b=`user2` sed 's/'$a'/"E=/home/'$b'/temp"/g' < file1 > file2 sed: command garbled:... (3 Replies)
Discussion started by: yesmani
3 Replies

6. Shell Programming and Scripting

sed command garbled error

sed: command garbled: s/ri="*"/ri=" what i did is you can see below sed "s/ri=\"*\"/ri=\"$newri\"/" $2 > output how to solve this (2 Replies)
Discussion started by: pasricha.kunal
2 Replies

7. Shell Programming and Scripting

Sed command garbled question

for j in $(cat ${list_B}) do to_replace_2=$(grep $j ${useralias}_2) sed "s/^${j}/${to_replace_2}/p" ${entries} > ${entries}_2 mv ${entries}_2 ${entries} done Hi, I've the above sed command running in a script. Its basically looping through a file and replacing its beginning of line... (8 Replies)
Discussion started by: Jazmania
8 Replies

8. Shell Programming and Scripting

sed: command garbled error

Hi all, Suppose that I want to update the db.password entry in the below properties file, db.username=admin db.password=qhKkBno2U5GEq5k/dnmGPA== //I want this line to be replaced by: "db.password=abc/123/" db.host=server db.port=22 db.sid=database However when... (2 Replies)
Discussion started by: isaacniu
2 Replies

9. Shell Programming and Scripting

sed help - Command garbled

Hi, First post for a noob so please go easy with me :) I have a XML block that is originally like this: <SETNAME>somecrap/THIS</SETNAME> and I would like it be replaced with, in the original file: <SETNAME>THIS</SETNAME> I tried to use: sed... (4 Replies)
Discussion started by: zhuanyi
4 Replies

10. Shell Programming and Scripting

Command garbled when using sed

Hi everyone, Can anyone help me in question below? I want to cron a job to add partition every month but get the error sed: command garbled: s/YYYYMM/ . > echo $YYYYMON_NEW 201304 > echo $YYYYMON_OLD 201208 > echo $YYYY_MM_NEW 2013-05 This is my base script: ALTER TABLE STS.ADMIN ADD... (1 Reply)
Discussion started by: fenocean
1 Replies
DateTime::Locale::tn_ZA(3)				User Contributed Perl Documentation				DateTime::Locale::tn_ZA(3)

NAME
DateTime::Locale::tn_ZA SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'tn_ZA' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Tswana South Africa. DATA
This locale inherits from the DateTime::Locale::tn locale. It contains the following data. Days Wide (format) Mosopulogo Labobedi Laboraro Labone Labotlhano Matlhatso Tshipi Abbreviated (format) Mos Bed Rar Ne Tla Mat Tsh Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) Mosopulogo Labobedi Laboraro Labone Labotlhano Matlhatso Tshipi Abbreviated (stand-alone) Mos Bed Rar Ne Tla Mat Tsh Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) Ferikgong Tlhakole Mopitlo Moranang Motsheganang Seetebosigo Phukwi Phatwe Lwetse Diphalane Ngwanatsele Sedimonthole Abbreviated (format) Fer Tlh Mop Mor Mot See Phu Pha Lwe Dip Ngw Sed Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) Ferikgong Tlhakole Mopitlo Moranang Motsheganang Seetebosigo Phukwi Phatwe Lwetse Diphalane Ngwanatsele Sedimonthole Abbreviated (stand-alone) Fer Tlh Mop Mor Mot See Phu Pha Lwe Dip Ngw Sed Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide BC AD Abbreviated BC AD Narrow BC AD Date Formats Full 2008-02-05T18:30:30 = Labobedi, 2008 Tlhakole 05 1995-12-22T09:05:02 = Labotlhano, 1995 Sedimonthole 22 -0010-09-15T04:44:23 = Matlhatso, -10 Lwetse 15 Long 2008-02-05T18:30:30 = 2008 Tlhakole 5 1995-12-22T09:05:02 = 1995 Sedimonthole 22 -0010-09-15T04:44:23 = -10 Lwetse 15 Medium 2008-02-05T18:30:30 = 2008 Tlh 5 1995-12-22T09:05:02 = 1995 Sed 22 -0010-09-15T04:44:23 = -10 Lwe 15 Short 2008-02-05T18:30:30 = 08/02/05 1995-12-22T09:05:02 = 95/12/22 -0010-09-15T04:44:23 = -10/09/15 Default 2008-02-05T18:30:30 = 2008 Tlh 5 1995-12-22T09:05:02 = 1995 Sed 22 -0010-09-15T04:44:23 = -10 Lwe 15 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = Labobedi, 2008 Tlhakole 05 18:30:30 UTC 1995-12-22T09:05:02 = Labotlhano, 1995 Sedimonthole 22 09:05:02 UTC -0010-09-15T04:44:23 = Matlhatso, -10 Lwetse 15 04:44:23 UTC Long 2008-02-05T18:30:30 = 2008 Tlhakole 5 18:30:30 UTC 1995-12-22T09:05:02 = 1995 Sedimonthole 22 09:05:02 UTC -0010-09-15T04:44:23 = -10 Lwetse 15 04:44:23 UTC Medium 2008-02-05T18:30:30 = 2008 Tlh 5 18:30:30 1995-12-22T09:05:02 = 1995 Sed 22 09:05:02 -0010-09-15T04:44:23 = -10 Lwe 15 04:44:23 Short 2008-02-05T18:30:30 = 08/02/05 18:30 1995-12-22T09:05:02 = 95/12/22 09:05 -0010-09-15T04:44:23 = -10/09/15 04:44 Default 2008-02-05T18:30:30 = 2008 Tlh 5 18:30:30 1995-12-22T09:05:02 = 1995 Sed 22 09:05:02 -0010-09-15T04:44:23 = -10 Lwe 15 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 Bed 1995-12-22T09:05:02 = 22 Tla -0010-09-15T04:44:23 = 15 Mat Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = Bed, 2-5 1995-12-22T09:05:02 = Tla, 12-22 -0010-09-15T04:44:23 = Mat, 9-15 MMM (LLL) 2008-02-05T18:30:30 = Tlh 1995-12-22T09:05:02 = Sed -0010-09-15T04:44:23 = Lwe MMMd (MMM d) 2008-02-05T18:30:30 = Tlh 5 1995-12-22T09:05:02 = Sed 22 -0010-09-15T04:44:23 = Lwe 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = Bed Tlh 5 1995-12-22T09:05:02 = Tla Sed 22 -0010-09-15T04:44:23 = Mat Lwe 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = Tlhakole 5 1995-12-22T09:05:02 = Sedimonthole 22 -0010-09-15T04:44:23 = Lwetse 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = Bed Tlhakole 5 1995-12-22T09:05:02 = Tla Sedimonthole 22 -0010-09-15T04:44:23 = Mat Lwetse 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = Bed, 2008-2-5 1995-12-22T09:05:02 = Tla, 1995-12-22 -0010-09-15T04:44:23 = Mat, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 Tlh 1995-12-22T09:05:02 = 1995 Sed -0010-09-15T04:44:23 = -10 Lwe yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = Bed, 2008 Tlh 5 1995-12-22T09:05:02 = Tla, 1995 Sed 22 -0010-09-15T04:44:23 = Mat, -10 Lwe 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 Tlhakole 1995-12-22T09:05:02 = 1995 Sedimonthole -0010-09-15T04:44:23 = -10 Lwetse yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Mosopulogo SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.16.3 2014-06-10 DateTime::Locale::tn_ZA(3)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy