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 > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Trying to empty file using > but the file size increasing when next append firdousamir UNIX for Dummies Questions & Answers 4 06-23-2008 03:37 AM
How to append to the file? vinay123 Shell Programming and Scripting 9 06-16-2008 03:20 PM
append file name contents to a target file gopskrish UNIX for Dummies Questions & Answers 2 10-27-2006 06:18 AM
Append a field to the end of each line of a file based on searching another file. ultimate Shell Programming and Scripting 2 03-29-2005 10:21 AM
Is there any way to append pdf files in UNIX? cp7800 Shell Programming and Scripting 2 03-19-2002 10:16 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-17-2008
sdosanjh sdosanjh is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 27
Append the file in UNIX

Hello All,

Could you please provide the solution to my following query
I have some files in my directory. I need to amend the total number of
lines to be added in the starting
line of each file.

For example, please refer the content of the file "file.dat" below.

\h:\w #> cat file.dat
hai
hello
end
Nice day
\h:\w #>

After your command, the output should be below.

\h:\w #> cat file.dat
Total no. of lines: 4
hai
hello
end
Nice day
\h:\w #>

We can do this in sed and awk through a single command. But we will
avoid the sed and awk stuff's for some time.
and can just try using simple unix commands for now.

Regards,
Sandeep
  #2 (permalink)  
Old 07-17-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,715
This is homework. Please do not post homework.
Sponsored Links
Closed Thread

Bookmarks

Tags
unix commands

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 04:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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