Sponsored Content
Top Forums Shell Programming and Scripting Removal of last-semicolons in line with sed Post 302564251 by CarloM on Thursday 13th of October 2011 07:44:32 AM
Old 10-13-2011
You lost the '*'.

Also, if you're not removing whitespace you don't need it in the regexp:
Code:
# sed 's/;*$//' /tmp/aaa
asd asd asd asd asdas;das dasdasD;SAdasDAS;D
asdasdasd;ASDAS;DAS;D;ASdas;DAS;D;AS
asdasdasdas das d asd asd as d asd as

(GNU sed 4.1.5 on bash)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Special Character SED/AWK removal

I have a script that produces an output containing '/.ssh'. I am trying to find a way of parsing only this data from a single line, without removing any other special characters contained within the output as a result of the parse. Any help would be appreciated (6 Replies)
Discussion started by: Raggedranger333
6 Replies

2. Shell Programming and Scripting

Column Search and Line Removal

Hello Gurus, I need to remove lines within a file if it contains specific criteria. Here is what I am trying to resolve: Users of AppRuntime: (Total of 10 licenses issued; Total of 6 licenses in use) buih02 dsktp501 AppGui 1 (compute_lic/27006 3122), start Mon 2/22 7:58 dingj1... (3 Replies)
Discussion started by: leepet01
3 Replies

3. Shell Programming and Scripting

Removal of new line character in double quotes

Hi, Could you please help me in removal of newline chracter present in between the double quotes and replacing it with space. For example ... Every field is wrapped with double quotes with comma delimiter, so I need to travese from first double quote occerence to till second double... (7 Replies)
Discussion started by: vsairam
7 Replies

4. Shell Programming and Scripting

Adding semicolons

Lets say I wanted to add a ; before the last 6 characters of my variable how would I do this? (2 Replies)
Discussion started by: puttster
2 Replies

5. Shell Programming and Scripting

any savant ? using AWK/SED to remove newline character between two strings : conditional removal

I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex ) ---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1 -- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Discussion started by: sieger007
4 Replies

6. Shell Programming and Scripting

sed help with character removal

Hello I've got a string of text with a number in pence, e.g. 0.52p, I need to remove the 'p' so that it just reads 0.52 without of course removing all the other 'p' characters. Many thanks (1 Reply)
Discussion started by: mrpugster
1 Replies

7. UNIX for Dummies Questions & Answers

2 semicolons

Just wondering what 2 semicolons together after a command means (2 Replies)
Discussion started by: millsy5
2 Replies

8. Shell Programming and Scripting

Duplicate line removal matching some columns only

I'm looking to remove duplicate rows from a CSV file with a twist. The first row is a header. There are 31 columns. I want to remove duplicates when the first 29 rows are identical ignoring row 30 and 31 BUT the duplicate that is kept should have the shortest total character length in rows 30... (6 Replies)
Discussion started by: Michael Stora
6 Replies

9. Shell Programming and Scripting

Honey, I broke awk! (duplicate line removal in 30M line 3.7GB csv file)

I have a script that builds a database ~30 million lines, ~3.7 GB .cvs file. After multiple optimzations It takes about 62 min to bring in and parse all the files and used to take 10 min to remove duplicates until I was requested to add another column. I am using the highly optimized awk code: awk... (34 Replies)
Discussion started by: Michael Stora
34 Replies

10. Shell Programming and Scripting

Section Removal With sed; and With a Twist . . .

Hello folks! Raised a bump on my head trying to figure this one out ;) I have an xml file which needs to be edited, removing an entire property section in the work. Here's what the target section layout looks like: <property name="something"> {any number of lines go here} </property>... (7 Replies)
Discussion started by: LinQ
7 Replies
LUSH(1) 						       Lisp Universal Shell							   LUSH(1)

NAME
lush - Lisp Universal Shell SYNOPSIS
lush [@initfile][lushfile...args...] DESCRIPTION
lush starts the Lisp Universal Shell. Lush is an object-oriented Lisp interpreter/compiler with features designed to please people who want to prototype large numerical applica- tions. Lush includes an extensive library of vector/matrix/tensor manipulation, a set of graphic functions, a simple GUI toolkit, and interfaces to various libraries such as OpenGL, SDL, the SGI Multimedia library (video/audio grabbing), the Numerical Recipes library, and others. Lush is an ideal frontend script language for programming projects written in C or other languages. RUNNING LUSH INTERACTIVELY
Online help on the standard library is available by typing (helptool) at the Lush prompt. You can leave Lush by typing CTRL-D at the prompt. On startup, Lush loads various libraries from the sys and lsh directories, as well as a .lushrc file in the user's home directory. It is recommended to add a directory lsh in your home directory and to include the line (addpath "your-home-directory/lsh") to your .lushrc so that your own Lush programs are found in Lush's search path. It is quite convenient to run Lush from within Emacs, which can be done by creating somewhere in your path a symbolic link named "lisp" to the lush executable. Then, type ESC-X run-lisp in Emacs. It is probably a good idea to add the following line in your .emacs so Emacs switches to Lisp mode when editing a Lush file: (setq auto-mode-alist (append (cons ".lsh$" 'lisp-mode) auto-mode-alist)) RUNNING NON-INTERACTIVE LUSH SCRIPTS In Unix, Lush can be used to write scripts that can be called from a shell prompt (like shell or Perl scripts). A list of command-line arguments are put in the argv variable. Here is an example: create a file (say "capargs") with the following content (replacing the first line by the path to your lush exe- cutable): #!/bin/sh exec lush "$0" "$@" !# (printf "capitalizing the arguments:0) (each ((arg argv)) (printf "%s %s0 arg (upcase arg))) then, make capargs executable: chmod a+x capargs. You can now invoke capargs at the shell prompt: % capargs asd gfdf capitalizing the arguments: capargs CAPARGS asd ASD gfdf GFDF FILES
/usr/share/lush The top of the Lush directory structure /usr/share/lush/src Source code of the interpreter /usr/share/lush/sys Core libraries (lush sources) without which Lush cannot run. A minimal/customized version of Lush needs only that directory to run. /usr/share/lush/etc Various shell scripts and utilities /usr/share/lush/include /usr/share/lush/lsh Library files (lush sources) that are part of the standard distribution. Although they are not required for Lush to run, life would really suck without them. /usr/share/lush/packages Library files (lush sources) for special applications or platforms, or programs that have been contributed by users and cannot be assumed to be present/working in all installations of Lush. /usr/share/lush/local Lush libraries that are specific to your site. ~/.lushrc Personal Lush initialization file ~/.lush Personal Lush directory: on-demand built libraries, etc HISTORY
Lush is the direct descendant of the SN system. SN was first developed as a neural network simulator with a Lisp-like scripting language. The project was started in 1987 by Leon Bottou and Yann LeCun, and rewritten several times since then. SN was used at AT&T for many research projects in machine learning, pattern recognition, and image processing. Its various incarnations were used at AT&T Bell Labs, AT&T Labs, the Salk Institute, the University of Toronto, Universite of Montreal, UC Berkeley, and many other research institutions. The commercial versions of SN were used in several large companies as a prototyping tool: Thomson-CSF, ONERA. SEE ALSO
Use (helptool) in an interactive lush session for browsing of online documentation. AUTHORS
Lush was written by Leon Bottou and Yann LeCun. Contributors include: Patrice Simard, Yoshua Bengio, Jean Bourrelly, Patrick Haffner, Pas- cal Vincent, Sergey Ioffe, and many others. This manual page was written by Kevin Rosenberg <kmr@debian.org> for the Debian Project (but may be used by others). 1.1 2005-12-14 LUSH(1)
All times are GMT -4. The time now is 01:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy