The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need to replace the first word of a line if it occurs again in the next line(shell) geeko Shell Programming and Scripting 4 06-18-2009 02:36 PM
Read line by line not word by word vadharah Shell Programming and Scripting 6 03-02-2008 02:29 PM
how to move word by word on command line pbsrinivas UNIX for Dummies Questions & Answers 1 11-23-2007 06:17 AM
put each word in new line - sed or tr hemangjani Shell Programming and Scripting 3 09-13-2006 02:06 PM
Can a shell script pull the first word (or nth word) off each line of a text file? tricky Shell Programming and Scripting 5 08-17-2006 06:29 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-18-2008
bullz26 bullz26 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 78
cut last line of a word

Hi all,

want to delete a crahecter from each line..?

how can i do it...
  #2 (permalink)  
Old 03-18-2008
cooldude cooldude is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 44
Could you give an example?
  #3 (permalink)  
Old 03-18-2008
era
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
The subject says "last line of word" and the text says "a character". We can speculate that this means the last character of each line, or of each word ...?

Code:
sed -e 's/.$//'   # last character
sed -e 's/.\( \|$\)//'  # every character before a space or end of line
Does this get you moving in any particular direction ...?

Last edited by era; 03-18-2008 at 11:42 AM.. Reason: Backslash key got borked \-:
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:46 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0