473,569 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

unix command for append or add text....

2 New Member
hai everyone.....
anybody can tell me how to append or add text to end of first and last line....
now i try using sed, when i run it run ok but when i view the filename the output not come out.......plz help me....
Aug 27 '07 #1
2 3395
radoulov
34 New Member
Expand|Select|Wrap|Line Numbers
  1. $ cat file
  2. line1
  3. line2
  4. line3
  5. $ sed '1{s/$/ appended/;}
  6. > ${s/$/ appended/;}' file
  7. line1 appended
  8. line2
  9. line3 appended
Aug 27 '07 #2
khaijahat
2 New Member
but when i run i get the value, then when i open the file nothing appended....
Aug 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

17
1904
by: Franz Steinhaeusler | last post by:
Hello, I need a regularexpression, which trims trailing whitespaces. While with unix line endings, it works; but not with Window (Dos) CRLF's: >>> import re >>> retrailingwhitespace = re.compile('(?<=\S)+$', re.MULTILINE) 1) Windows >>> r="erewr \r\nafjdskl "
9
8309
by: craig.overton | last post by:
All, I am currently developing an FTP class in VB.NET. It's kid tested, mother approved when trying to access an FTP Server on a Windows box meaning I can connect, run commands, upload and download a file no problem. My issues come when I try to use the same class with the same commands to access an FTP server on a UNIX box. I can connect...
0
1387
by: audleman | last post by:
I have an ASP form on my website where a visitor enters information. On submit, the form calls a stored procedure stores in a MS SQL 2000 database. The stored procedure works most of the time, but every once in a while I get an error 3421 (Application uses a value of the wrong type for the current operation) when I try to append the last...
0
1473
by: Holly | last post by:
I copied this code that works to connect into Unix. I am looking for a way to get it to work with a secure Unix box. Anyone have any insights on how to do this? I am trying to build an sftp service. Thanks Holly Imports System Imports System.Net Imports System.IO
2
1807
by: Radu | last post by:
Hi. I have a page with the following html: __________________________________________________________ <h1>Dynamic Controls Test</h1> <hr /> <asp:TextBox ID="txtProduct1" Text="txtProduct 1" runat="server"></ asp:TextBox> <asp:Button ID="cmdAddRow" Text="+" AccessKey="+" runat="server" /> <asp:Button ID="cmdSubtractRow" Text="-"...
11
2718
ironmonkey69
by: ironmonkey69 | last post by:
Right now, I have this python script that lets me choose which column of a text file that I can zero out. Them column nubmer is stored as the variable 'elem'. I also was given a sample of taking in command line arguements. I was wondering if anyone could help me intergrate this into the code so that from the command line I can input a number...
4
2445
by: foal11 | last post by:
Hi all, My problem is that I have generated a text file on unix which I want to print on a neoware(Neolinux) box. The problem is that the line length is 2 big so when I print it the text is wrapped around.In windows we have the option of reducing font and printing.Is there any such option available on Unix..? The files to be printed...
2
1595
by: foal11 | last post by:
Hi all, My problem is that I have generated a text file on unix which I want to print on a neoware(Neolinux) box. The problem is that the line length is 2 big so when I print it the text is wrapped around.In windows we have the option of reducing font and printing.Is there any such option available on Unix..? The files to be printed...
65
5036
by: Hongyu | last post by:
Dear all: I am trying to write to a file with full directory name and file name specified (./outdir/mytestout.txt where . is the current directory) in C programming language and under Unix, but got errors of Failed to open file ./outdir/mytestout.txt. Below is the code: #include <stdio.h>
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.