Sponsored Content
Full Discussion: about "sed" command in unix
Top Forums Shell Programming and Scripting about "sed" command in unix Post 302116466 by gopsman on Friday 4th of May 2007 06:28:50 AM
Old 05-04-2007
about "sed" command in unix

hi i want to append a string to some selected lines in a file. how to do that using sed?

if the file looks like this

hello i am here
welcome to the blk
hello how are you
unix roollls!!
windows, what is that??


i want to append string "fine" to the end of all lines starting with hello.it should appear like this

hello i am here fine
welcome to the blk
hello how are you fine
unix roollls!!
windows, what is that??


any suggestions , folks??
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix "sed" command

Hello , I just wanted to know how to apend to a text in a file using "sed" command. suppose i have a text "Jaya" in the file "name". I wanted to append "thirtha" to it ,so that it displays "Jayathirtha" as a whole. Help me out. Thank You, Jay. Hi, sed -e 's/$/thirtha' <filename>... (1 Reply)
Discussion started by: Jayathirtha
1 Replies

2. UNIX for Advanced & Expert Users

Commands on Digital Unix equivalent to for "top" and "sar" on other Unix flavour

Hi, We have a DEC Alpha 4100 Server with OSF1 Digital Unix 4.0. Can any one tell me, if there are any commands on this Unix which are equivalent to "top" and "sar" on HP-UX or Sun Solaris ? I am particularly interested in knowing the CPU Load, what process is running on which CPU, etc. ... (1 Reply)
Discussion started by: sameerdes
1 Replies

3. UNIX for Dummies Questions & Answers

Unix "at" / "Cron" Command New Problem...Need help

Hi All, I am trying to schedule a one time job using the at command with the help of shell script for my project. The shell script should take a parameter as a command line argument from the at command itself. Is it possible to take a command line parameter for a shell script in the command... (3 Replies)
Discussion started by: Mohanraj
3 Replies

4. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

5. Shell Programming and Scripting

Passing unix command to "sed"

I am trying a simple sed to replace a pattern but it fails ,,c an someone help in where iam wrong, here is what i run and i get no o/p a=`cat abc.sh | grep -i pattern1 | egrep -iv "pattern2" ` sed 's/`echo $a`/XYZ=newvalue/g' < abc.sh > abc.sh_new This is how my ksh -x of teh script looks... (2 Replies)
Discussion started by: yesmani
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

8. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

9. Shell Programming and Scripting

sed returns error "sed: -e expression #1, char 18: unterminated `s' command"

Hello All, I have something like below LDC100/rel/prod/libinactrl.a LAA2000/rel/prod/libinactrl.a I want to remove till first forward slash that is outputshould be as below rel/prod/libinactrl.a rel/prod/libinactrl.a How can I do that ??? (8 Replies)
Discussion started by: anand.shah
8 Replies

10. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
mlib_VolumeRayCast_Blocked(3MLIB)			    mediaLib Library Functions				 mlib_VolumeRayCast_Blocked(3MLIB)

NAME
mlib_VolumeRayCast_Blocked, mlib_VolumeRayCast_Blocked_Parallel_Nearest_U8_U8, mlib_VolumeRayCast_Blocked_Parallel_Nearest_S16_S16, mlib_VolumeRayCast_Blocked_Parallel_Trilinear_U8_U8, mlib_VolumeRayCast_Blocked_Parallel_Trilinear_S16_S16, mlib_VolumeRay- Cast_Blocked_Divergent_Nearest_U8_U8, mlib_VolumeRayCast_Blocked_Divergent_Nearest_S16_S16, mlib_VolumeRayCast_Blocked_Divergent_Trilin- ear_U8_U8, mlib_VolumeRayCast_Blocked_Divergent_Trilinear_S16_S16 - cast a ray (or rays) through a 3D data set SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_VolumeRayCast_Blocked_Parallel_Nearest_U8_U8 (mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Parallel_Nearest_S16_S16 (mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Parallel_Trilinear_U8_U8 (mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Parallel_Trilinear_S16_S16 (mlib_rays *rays const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Divergent_Nearest_U8_U8 (mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Divergent_Nearest_S16_S16 (mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Divergent_Trilinear_U8_U8 (mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Divergent_Trilinear_S16_S16 (mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); DESCRIPTION
Each of these functions casts a ray (or rays) through a three-dimensional(3D) data set, then computes and returns the interpolated samples at each step along the way. In trilinear interpolation, the value at point P is computed from its eight surrounding neighbors based on the equation below. P = (1-a)*(1-b)*(1-c)*P0 + a*(1-b)*(1-c)*Px + (1-a)*b*(1-c)*Py + (1-a)*(1-b)*c*Pz + a*b*(1-c)*Pxy + a*(1-b)*c*Pxz + (1-a)*b*c*Pyz + a*b*c*Pxyz where a, b, and c are the fractional parts of the coordinates of point P. The trilinear interpolation is represented by the following figure: Printed copy or docs.sun.com displays a figure that represents the trilinear interpolation. In nearest neighbor operation, the sample value at point P is replaced by the value of the nearest neighbor voxel. PARAMETERS
Each of the functions takes the following arguments: rays Casting rays. blk Volume data in the blocked format. buffer Working buffer. RETURN VALUES
Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_VolumeRayCast_General(3MLIB), attributes(5) SunOS 5.11 2 Mar 2007 mlib_VolumeRayCast_Blocked(3MLIB)
All times are GMT -4. The time now is 04:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy