Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sed $ appending to front, not to the end Post 302416820 by DrSammyD on Wednesday 28th of April 2010 01:05:25 AM
Old 04-28-2010
Sed $ appending to front, not to the end

I keep trying to append some astrix to the end of a line, but it keeps overwriting at the front of the line.

These are the originals

Code:
Fred Fardbarkle:674-843-1385:20 Parak Lane, Duluth, MN 23850:4/12/23:780900
Fred Fardbarkle:674-843-1385:20 Parak Lane, Duluth, MN 23850:4/12/23:780900

Here's the output

Code:
***d Fardbarkle:674-843-1385:20 Parak Lane, Duluth, MN 23850:4/12/23:780900
***d Fardbarkle:674-843-1385:20 Parak Lane, Duluth, MN 23850:4/12/23:780900

It's supposed to look like this
Code:
Fred Fardbarkle:674-843-1385:20 Parak Lane, Duluth, MN 23850:4/12/23:780900***
Fred Fardbarkle:674-843-1385:20 Parak Lane, Duluth, MN 23850:4/12/23:780900***

My code looks like this
Code:
sed '/^Fred/s/$/***/' inputfile

Does that make any sense at all? Is there any situation where it would do that?

---------- Post updated at 11:59 PM ---------- Previous update was at 09:49 PM ----------

If you think it should work, please tell me, so that maybe I can go about installing a different version of sed.

---------- Post updated 04-28-10 at 01:05 AM ---------- Previous update was 04-27-10 at 11:59 PM ----------

Figured it out.

apparently sed needs a . before the $
the proper code looks like this

Code:
sed '/^Fred/s/.$/***/' inputfile

 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Front end on Unix

Hi, I would like to develop a user interface on Solaris. Can anybody throw some light on currently available software utilities/ packages..? Thanks in Advance .. JS (4 Replies)
Discussion started by: shibz
4 Replies

2. Programming

Running exe's from front end

Hi, I have created a tool which analyses and debugs cobol programs on Unix environment usin the C files. I now want to create a frontend for the tool in windows. For this i need to establish some kinda communication between the front the end and the back end. I know pipes in one way of... (0 Replies)
Discussion started by: Sinbad
0 Replies

3. Shell Programming and Scripting

remove space in front or end of each field

Hi, I have a txt file called a.txt which contain over 10,000 records and I would like to remove space before comma or after comma....like below: The input (for example two record 00001,00002): 00001,client,card limited ,02292,N ,162:41 , 192, ... (6 Replies)
Discussion started by: happyv
6 Replies

4. Shell Programming and Scripting

Appending the last few columns to the front

Hi consider this as the first line 00010015 MORGAN STANLEY & CO INCORPORATED N 110 INVESTAR 1 0001OT NJ 201-830-5055 01-Jan-1974 00:00:00 1 01-May-2008 00:00:00 05-Jun-2008 13:34:18 0001 - From SMSRun1_GIDQA02 Consider this as the second line 00010015 MORGAN STANLEY... (3 Replies)
Discussion started by: ragavhere
3 Replies

5. UNIX for Dummies Questions & Answers

Communicate to the OS(linux) using front end.

Hi guys , I want to develop a web page which is capable of executing the command on os and show the output on the browser.(Which involves reading and writing too.) I m using jsp language to develop the web page. How would i use it to communicate with my linux server? Any... (3 Replies)
Discussion started by: pinga123
3 Replies

6. UNIX for Dummies Questions & Answers

Appending columns at the end of output using awk/sed

Hi , I have the below ouput, =====gopi===== assasassaa adsadsadsdsada asdsadsadasdsa sadasdsadsd =====kannan=== asdasdasd sadasddsaasd adasdd =====hbk=== asasasssa .... .. I want the output like as below, not able paste here correctly. (2 Replies)
Discussion started by: eeegopikannan
2 Replies

7. Programming

Publish notification via application front end

hi All I use tomcat server to publish war file. How to send an notification to users via the application screen and it should dismiss once user clicks X mark. Any suggestions ? (0 Replies)
Discussion started by: anil529
0 Replies

8. Programming

Recommendation: gede - graphical gdb front-end

gede is a graphical debugger, a front-end for good ole uncle gdb. gede doesn't need a specialized gdb version. :b: Unfortunately its a qt app, nevertheless it fits well in a gtk desktop environment.:eek: Its author Johan Henriksson is a smart and nice guy always open for bug reports and... (2 Replies)
Discussion started by: dodona
2 Replies
Locale::Codes::LangVar(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangVar(3pm)

NAME
Locale::Codes::LangVar - standard codes for language variation identification SYNOPSIS
use Locale::Codes::LangVar; $lvar = code2langvar('acm'); # $lvar gets 'Mesopotamian Arabic' $code = langvar2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langvar_codes(); @names = all_langvar_names(); DESCRIPTION
The "Locale::Codes::LangVar" module provides access to standard codes used for identifying language variations, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language variations. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lvar = code2langvar('en','alpha-2'); $lvar = code2langvar('en',LOCALE_CODE_ALPHA_2); The codesets currently supported are: alpha This is the set of alphanumeric codes from the IANA language registry, such as 'arevela' for Eastern Armenian. This code set is identified with the symbol "LOCALE_LANGVAR_ALPHA". This is the default code set. ROUTINES
code2langvar ( CODE [,CODESET] ) langvar2code ( NAME [,CODESET] ) langvar_code2code ( CODE ,CODESET ,CODESET2 ) all_langvar_codes ( [CODESET] ) all_langvar_names ( [CODESET] ) Locale::Codes::LangVar::rename_langvar ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangVar::add_langvar ( CODE ,NAME [,CODESET] ) Locale::Codes::LangVar::delete_langvar ( CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_alias ( NAME ,NEW_NAME ) Locale::Codes::LangVar::delete_langvar_alias ( NAME ) Locale::Codes::LangVar::rename_langvar_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::delete_langvar_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2012 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 Locale::Codes::LangVar(3pm)
All times are GMT -4. The time now is 11:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy