Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Deleting contents of a UNIX File Post 302209477 by manas6 on Friday 27th of June 2008 04:50:05 AM
Old 06-27-2008
Sorry!!
This is not working.
Could you pleace give me the clear sintax.


Thanks for your time.



Manas
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove the contents of a file without deleting the file

Hi All, I want to delete the contents of few files which are really huge in size. How the same can be done by using sed. Is there any other alternative to sed. Thanks in advance (10 Replies)
Discussion started by: sumesh.abraham
10 Replies

2. Shell Programming and Scripting

Query:just need to remove the contents of the file without deleting that

Hii, Please suggest me how can i only remove the contents of the file without deleting it. (3 Replies)
Discussion started by: namishtiwari
3 Replies

3. HP-UX

how to redirect the growing contents of log file to another file in unix

how to redirect the growing contents of log file to another file in unix (2 Replies)
Discussion started by: megh
2 Replies

4. Shell Programming and Scripting

Deleting the contents of a folder older than X hours

Every day a new .zip file is uploaded to a folder and at mid-night the zip file is to be extracted into a /data/ folder, inside a date-named folder. # This should extract the contents of a zip file into the /data/ folder into a date based folder /usr/bin/unzip -a -o... (15 Replies)
Discussion started by: worchyld
15 Replies

5. UNIX for Dummies Questions & Answers

Script For Deleting Contents of "Live" Log File

In our shop, we have a situation where a log file from our interface engine software has begun maxing out in file size (reaching the 32-bit "2147483647" limit). Currently, the only way to rectify this is to stop the interface and restart it, which generates a new log. Easy enough, but the... (6 Replies)
Discussion started by: rjhjr64
6 Replies

6. UNIX for Dummies Questions & Answers

How to add/sum same contents in a unix file

Input 1 2N 2N 1 2N 2N 1 2N 2N 1 2N Ateus 1 3 Mobiles 3M-100 1 3 Mobiles 3M-100 1 3 Mobiles 3M-100 1 3GNET 3gnet 1 3GNET 3gnet 1 3GNET G2828 1 3GNET G2828 1 3GNET G2829 1 3GNET G2829 1 3GNET G2829 OutPut should be 3 2N 2N 3 3 Mobiles 3M-100 2 3GNET 3gnet (4 Replies)
Discussion started by: gagan2010
4 Replies

7. Shell Programming and Scripting

How to clear contents of a file without deleting it.

Hi, I have a script which will use an input.txt file as an input file. I am providing data to this input file in the script and once the script is executed, I want to clear all the contents of this file as during the second time use of this script, I'll be appending the data in this input... (5 Replies)
Discussion started by: pat_pramod
5 Replies

8. UNIX for Dummies Questions & Answers

Write terminal contents into a one file in UNIX

Hi guys, How to write terminal contents into a file in Unix operating system Actually I created GUI by using Gtk2-perl. I want to display data on GUI whatever the contents writing on terminal. So which command I have to use and where that command to be run I mean in shell script or Perl... (2 Replies)
Discussion started by: kiran425
2 Replies

9. UNIX for Dummies Questions & Answers

What option will use for deleting directory with all its contents?

Hi How to completely delete directory with all it contents I try to use rmdir -r but it give error Thanks ---------- Post updated at 03:10 AM ---------- Previous update was at 02:52 AM ---------- Hi all I got the solution for my thread i use mkdir with the option -p Thanks (1 Reply)
Discussion started by: Tauatioti
1 Replies

10. UNIX for Beginners Questions & Answers

UNIX utility to find difference in folder, file and contents of file against a base version

Hi, I am trying to find out whether there are any Unix utilities that compares folders, files and contents within the file and provides a comprehensive report. The comparison can be against base version of a folder and file with content. Can you please let me know of such a utility? Thanks,... (6 Replies)
Discussion started by: Sripathi_ks
6 Replies
mcs(1)								   User Commands							    mcs(1)

NAME
mcs - manipulate the comment section of an object file SYNOPSIS
mcs [-cdpVz] [-a string] [-n name] file... DESCRIPTION
The mcs command is used to manipulate a section, by default the .comment section, in an ELF object file. It is used to add to, delete, print, and compress the contents of a section in an ELF object file, and print only the contents of a section in a COFF object file. mcs cannot add, delete, or compress the contents of a section that is contained within a segment. If the input file is an archive (see ar.h(3HEAD)), the archive is treated as a set of individual files. For example, if the -a option is specified, the string is appended to the comment section of each ELF object file in the archive; if the archive member is not an ELF object file, then it is left unchanged. mcs must be given one or more of the options described below. It applies, in order, each of the specified options to each file. OPTIONS
The following options are supported: -a string Appends string to the comment section of the ELF object files. If string contains embedded blanks, it must be enclosed in quotation marks. -c Compresses the contents of the comment section of the ELF object files. All duplicate entries are removed. The ordering of the remaining entries is not disturbed. -d Deletes the contents of the comment section from the ELF object files. The section header for the comment section is also removed. -n name Specifies the name of the comment section to access if other than .comment. By default, mcs deals with the section named .comment. This option can be used to specify another section. mcs can take multiple -n options to allow for specification of multiple section comments. -p Prints the contents of the comment section on the standard output. Each section printed is tagged by the name of the file from which it was extracted, using the format file[member_name]: for archive files and file: for other files. -V Prints on standard error the version number of mcs. -z Replaces any SHT_PROGBITS sections with zeros while retaining the original attributes of the sections. EXAMPLES
Example 1: Printing a file's comment section The following entry example% mcs -p elf.file prints the comment section of the file elf.file. Example 2: Appending a string to a comment section The following entry example% mcs -a xyz elf.file appends string xyz to elf.file's comment section. FILES
/tmp/mcs* temporary files ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbtool | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ SEE ALSO
ar(1), as(1), ld(1), ar.h(3HEAD), elf(3ELF), tmpnam(3C), a.out(4), attributes(5) NOTES
When mcs deletes a section using the -d option, it tries to bind together sections of type SHT_REL and target sections pointed to by the sh_info section header field. If one is to be deleted, mcs attempts to delete the other of the pair. By using the -z option, it is possible to make an object file by removing the contents of SHT_PROGBITS sections while retaining the object file's original structure as an ELF file. The need for use of the -z option is limited. However, the option can be used to deliver an object file when the contents of SHT_PROGBITS sections are not relevant. SunOS 5.10 1 Apr 2004 mcs(1)
All times are GMT -4. The time now is 06:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy