Sponsored Content
Top Forums UNIX for Dummies Questions & Answers using sed to append text to the end of each line Post 82179 by Redg on Monday 29th of August 2005 01:55:44 PM
Old 08-29-2005
Works Great...Thanks for your help
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append text at end of the first line in a file

Hi I need to append some text @ end of the first line in a file. like myfile.txt list = a,b,c list.a=some.. I give the arg "d" . now it append at end of first line list=a,b,c,d list.a=some... Please help me out this (7 Replies)
Discussion started by: catgovind
7 Replies

2. Shell Programming and Scripting

Sed : identify a pattern and append a word at the end of a line

Hello to all, On aix, I want to identify a term on a line in a file and then add a word at the end of the line identified. I do not want the word to be added when the line contains the symbol "#". I use the following command, but it deletes the term identified then adds the word. #sed... (4 Replies)
Discussion started by: dantares
4 Replies

3. Shell Programming and Scripting

Append text to end of line on all lines

Hi, I've spent some time researching for this but can't seem to find a solution. I have a file like this 1234|Test|20101111|18:00|19:00There will be multiple lines in the file with the same kind of format. For every line I need to make it this 1234|Test|20101111|18:00|19:00||create... (5 Replies)
Discussion started by: giles.cardew
5 Replies

4. Shell Programming and Scripting

append text from file1 to the end of each line in file2

hi; my file2.txt:portname=1;list=10.11;l- portname=2;list=10.12;l- portname=3;list=10.13;l- ... my file1.txt:;"{'sector=%27'}"\&> so; i want to see:portname=1;list=10.11;l-;"{'sector=%27'}"\&> portname=2;list=10.12;l-;"{'sector=%27'}"\&> portname=3;list=10.13;l-;"{'sector=%27'}"\&>... (4 Replies)
Discussion started by: gc_sw
4 Replies

5. Shell Programming and Scripting

Append text to end of every line

I've scoured the internet with mixed results. As an amateur I turn to the great minds here. I have a text file of 80 or so lines. I want to add ".pdf" to the end of each line. (For now that's it) Most of the internet points toward using "sed". I don't know coding but can figure things out... (4 Replies)
Discussion started by: spacebase
4 Replies

6. Shell Programming and Scripting

find a certain line and append text to the end of the line

After I create printer queues in AIX, I have to append a filter file location within that printers custom file. within lets say test_queue.txt I need to find the row that starts with :699 and then I need to append on the end the string /usr/local/bin/k_portrait.sh. Now I've gotten the sed... (2 Replies)
Discussion started by: peachclift
2 Replies

7. Shell Programming and Scripting

Append text to line if begins with pattern1 AND does not end with pattern2

Hello, I'm looking for sed solution to change ... <li>keyword</li> <li>keyword <li>keyword</li> <li>keyword <li>keyword</li> ... to ... <li>keyword</li> <li>keyword</li> <li>keyword</li> <li>keyword</li> <li>keyword</li> ... I.e., if lines beginning with <li> do not end with... (3 Replies)
Discussion started by: pioavi
3 Replies

8. Shell Programming and Scripting

SED and Solaris Append line to the end of File does not work

Hello, I have to add a new line at the end of a File on Solaris-System: I think my script should be right, because I evaluated it to other threads. However the script does not what I am expected it should do. My file might look like this: Line1 Line2 Line3 And my script could... (7 Replies)
Discussion started by: Timo_HR
7 Replies

9. Shell Programming and Scripting

sed - Find a String and append a text end of the Line

Hi, I have a File, which have multiple rows. Like below 123456 Test1 FNAME JRW#$% PB MO Approver XXXXXX. YYYY 123457 Test2 FNAME JRW#$% PB MO Super XXXXXX. YYYY 123458 Test3 FNAME JRW#$% PB MO Approver XXXXXX. YYYY I want to search a line which contains PB MO Approver and append... (2 Replies)
Discussion started by: java2006
2 Replies

10. Shell Programming and Scripting

sed command to append word at end of line

hello Team, I am looking for sed command or script which will append word at end of line. for example. I want to validate particular filesystem with mount |<filesystem name> command. if nodev parameter is not there then it should add in the fstab file with receptive to the filesystem. # mount... (8 Replies)
Discussion started by: ghpradeep
8 Replies
mt(1)							      General Commands Manual							     mt(1)

Name
       mt - magnetic tape manipulating program

Syntax
       mt [-f tapename] command [count]

Description
       The command permits the operation of a magnetic tape drive.

Options
       The  -f	flag  option  uses  the specified tape device (next argument) in place of either that tape device defined by your TAPE environment
       variable (.login or .profile) or /dev/nrmt0h.

       Some operations may be performed multiple times by specifying count.  By default, performs the requested operation once.

       The command argument defines the operation to be performed.  Only as many characters as are required to uniquely identify a command need be
       specified.

       The following is a list of commands:

       bsf		   Backspace count files.

       bsr		   Backspace count records.

       cache		   Allows to use the cache buffer on a tape drive that has the cache buffer feature.

       clhrdsf		   Clear  hardware/software problem.  Works with tape drives which use the TMSCP tape controller interface This command is
			   restricted to root access only.

       clserex		   Clear serious exception.  Works with tape drives which use the TMSCP tape controller interface

       clsub		   Clear subsystem.  Works with tape drives which use the TMSCP tape controller interface This command	is  restricted	to
			   root access only.

       eof, weof	   Write count end-of-file marks at the current position on the tape.

       eotdis		   Disable  end-of-tape  detection.   When the end of tape is reached, the tape will run off the reel.	Only the superuser
			   can issue this command.  The command remains in effect for the device until end-of-tape detection is enabled  with  the
			   eoten command.

       eoten		   Enable  end-of-tape	detection.   When the end-of-tape markers are reached, the tape is halted on the reel, between the
			   two end-of-tape markers.  Only the superuser can issue this command.  The command remains  in  effect  for  the  device
			   until end-of-tape detection is disabled with the eotdis command.  This is the default mode after a system boot.

       fsf		   Forward-space count files.

       fsr		   Forward-space count records.

       nocache		   Disables the use of the cache buffer for any tape drive that has the cache buffer feature.

       offline, rewoffl    Rewind the tape and place the tape unit off-line.

       retension	   Retensions the tape.  Retension means moving the tape one complete pass between EOT and BOT.

       rewind		   Rewind the tape.

       status		   Print status information about the tape unit.

Examples
       This example shows how to rewind the tape
       mt -f /dev/rmt0l rewind
       This example shows how to backspace the tape nmt1h three files:
       mt -f /dev/nrmt1h bsf 3
       This example shows how to write two end-of-file marks at the current position on tape nmt6h:
       mt -f /dev/nrmt6h eof 2

Return Values
       In  shell  scripts, returns a 0 exit status when the operation(s) were successful, 1 if the command was unrecognized, and 2 if an operation
       failed.

Files
       /dev/rmt?h or /dev/rmt?l
		 Raw magnetic tape interface with rewind when closed

       /dev/nmt?h or /dev/nmt?l
		 Raw magnetic tape interface with no rewind when closed

See Also
       dd(1), tar(1), ioctl(2), mtio(4), tms(4), environ(7)

																	     mt(1)
All times are GMT -4. The time now is 06:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy