Sponsored Content
Full Discussion: Sed Tricks
Top Forums UNIX for Dummies Questions & Answers Sed Tricks Post 302363301 by zaxxon on Tuesday 20th of October 2009 02:51:42 AM
Old 10-20-2009
Code:
echo "old gold old" | sed 's/\<old\>/new/g'
new gold new

Inside < and > you can define a "word" in RegExp. Have to escape them with \ though.
 

6 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

tar tricks

Hello there, Is there anyway to make the tar utility print the contents of the files inside it (not list the files, but rather their contents) sequentially from the command line? What I ultimately would like to do is to have a way of printing the contents of each file in the tar archive... (2 Replies)
Discussion started by: neked
2 Replies

2. UNIX for Dummies Questions & Answers

Set prompt, problems and tricks

I'm using a csh shell (or, that'd be my guess from the .cshrc file I see) and I'm looking to change my prompt. There are about 10 other threads, I know, but this question is a little more specific. I want to know, is there a way to list the current directory from a certain level or directory... (6 Replies)
Discussion started by: HybridLogic
6 Replies

3. Shell Programming and Scripting

need couple of ksh tricks please

1) I ran myScript with 2 arguments, I meant to use 3 if I do r my, it will rerun it with the 2 arguments. is there a way I can do r my and add a third argument at the end? 2) say I did myAcript.ksh 2 5 7 8 I realise my typo. is there an easy way to redo the command replacing A with S? ... (4 Replies)
Discussion started by: JamesByars
4 Replies

4. Post Here to Contact Site Administrators and Moderators

Solaris tips and tricks

What do you think could we open new top topic with tips and tricks and to show to other users some tricks what do we know like dtrace , new virtual server , how to add new users etc. This is only suggestion (1 Reply)
Discussion started by: solaris_user
1 Replies

5. UNIX for Advanced & Expert Users

Basic VI tricks

I found a decent guide of VI basic tricks. This guide does expect you to have a decent understanding of VI. It does not go over very much beginner related. vi Manual (3 Replies)
Discussion started by: cokedude
3 Replies

6. UNIX for Beginners Questions & Answers

Vim tips and tricks

Vim Tips and Tricks Save and quit :w => Save :q => Exit as long as there have been no changes :q! => Exit and ignore any changes :wq => Save and Exit. :x => Exit, saving changes ZZ => Exit and save changes if any have been made :10,20w filename => writes the... (34 Replies)
Discussion started by: ungalnanban
34 Replies
FOLD(1) 								FSF								   FOLD(1)

NAME
fold - wrap each input line to fit in specified width SYNOPSIS
fold [OPTION]... [FILE]... DESCRIPTION
Wrap input lines in each FILE (standard input by default), writing to standard output. Mandatory arguments to long options are mandatory for short options too. -b, --bytes count bytes rather than columns -c, --characters count characters rather than columns -s, --spaces break at spaces -w, --width=WIDTH use WIDTH columns instead of 80 --help display this help and exit --version output version information and exit AUTHOR
Written by David MacKenzie. REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>. COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
The full documentation for fold is maintained as a Texinfo manual. If the info and fold programs are properly installed at your site, the command info fold should give you access to the complete manual. fold (coreutils) 4.5.3 February 2003 FOLD(1)
All times are GMT -4. The time now is 02:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy