Sponsored Content
Full Discussion: Remove content from file
Top Forums Shell Programming and Scripting Remove content from file Post 302087175 by jambesh on Wednesday 30th of August 2006 05:55:21 AM
Old 08-30-2006
what my approach is

today=`date '+%m-%d-Y'`
grep -v "$today" file_name >file_name

Last edited by jambesh; 08-31-2006 at 05:27 AM.. Reason: update
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove space from file content

i am a bit new to shell scripting i have a file containing xxxx xx xx but i want to output the content as xxxxxxxx. thus removing the space. any idea how i can do this (4 Replies)
Discussion started by: blackzinga
4 Replies

2. Shell Programming and Scripting

Remove specific content in a file

Hi, I have a file called fl_list consists of files i have to archive. I want to create a exception parm called except_parm, so if it finds the directory it will not archive these files and remove from fl_list. $ cat fl_list /apps/dev/ihub/ready/IA003B/IA003B_Deal_Header_yyyymmdd_hhmmss.txt... (1 Reply)
Discussion started by: k9cheung
1 Replies

3. Shell Programming and Scripting

Help with remove duplicate content and only keep the first content detail

Input data_10 SSA data_2 TYUE data_3 PEOCV data_6 SSAT data_21 SSA data_19 TYUEC data_14 TYUE data_15 SSA data_32 PEOCV . . Desired Output data_10 SSA data_2 TYUE data_3 PEOCV data_6 SSAT data_19 TYUEC (9 Replies)
Discussion started by: patrick87
9 Replies

4. Shell Programming and Scripting

Shell script to remove some content in a file

How can I remove all data that contain domain e.g zzgh@something.com, sdd@something.com.my and gg@something.my in one file? so that i only have data without the domain in the file. Here is the file structure "test.out" more test.out 1 zzztop@b.com 1 zzzulll 1 zzzullll@s.com.my ... (4 Replies)
Discussion started by: Mr_47
4 Replies

5. Shell Programming and Scripting

Help with remove duplicate content

Input file data_1 10 US data_1 2 US data_1 5 UK data_2 20 ENGLAND data_2 12 KOREA data_3 4 CHINA . . data_60 123 US data_60 23 UK data_60 45 US Desired output file data_1 10 US data_1 5 UK data_2 20 ENGLAND data_2 12 KOREA (2 Replies)
Discussion started by: perl_beginner
2 Replies

6. Shell Programming and Scripting

Remove the file content based on the Header of the file

Hi All, I want to remove the content based on the header information . Please find the example below. File1.txt Name|Last|First|Location|DepId|Depname|DepLoc naga|rr|tion|hyd|1|wer|opr Nava|ra|tin|gen|2|wera|opra I have to search for the DepId and remove the data from the... (5 Replies)
Discussion started by: i150371485
5 Replies

7. Shell Programming and Scripting

Remove some content from a verilog file

Hi, I have a verilog file which looks like module xyz (x, y, z, a, b, c); input x; input y; input z; output a; output b; output c; initial begin ... end always ... ... endmodule (7 Replies)
Discussion started by: matbrow
7 Replies

8. Shell Programming and Scripting

Remove the duplicate content in a file

Here is the contents of test.txt Dependencies Resolved Changes in packages about to be updated: ChangeLog for: 1:perl-Archive-Extract-0.38-131.el6_4.x86_64, - Resolves: #915692 - CVE-2013-1667 (DoS in rehashing code) Dependencies Resolved Changes in packages about to be updated: ... (5 Replies)
Discussion started by: ashokvpp
5 Replies

9. Shell Programming and Scripting

Script to remove same content from other file

Hi/ Hello all Guru here, I am trying to create script to remove same content from other file, already tested few idea and found that in unix it is limited to sort and uniq. There is many script for removing duplicate content however to delete all same content is non. Need your help and guide .... (7 Replies)
Discussion started by: Mr_47
7 Replies

10. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies
REALPATH(3)						   BSD Library Functions Manual 					       REALPATH(3)

NAME
realpath -- returns the canonicalized absolute pathname SYNOPSIS
#include <stdlib.h> char * realpath(const char *restrict file_name, char *restrict resolved_name); DESCRIPTION
The realpath() function resolves all symbolic links, extra ``/'' characters, and references to /./ and /../ in file_name. If the resolved_name argument is non-NULL, the resulting absolute pathname is copied there (it must refer to a buffer capable of storing at least PATH_MAX characters). As a permitted extension to the standard, if resolved_name is NULL, memory is allocated for the resulting absolute pathname, and is returned by realpath(). This memory should be freed by a call to free(3) when no longer needed. The realpath() function will resolve both absolute and relative paths and return the absolute pathname corresponding to file_name. All com- ponents of file_name must exist when realpath() is called. RETURN VALUES
On success, the realpath() function returns the address of the resulting absolute pathname, which is resolved_name if it was non-NULL, or the address of newly allocated memory. If an error occurs, realpath() returns NULL. If resolved_name was non-NULL, it will contain the pathname which caused the problem. VARIANTS
Defining _DARWIN_C_SOURCE or _DARWIN_BETTER_REALPATH before including stdio.h will cause the provided implementation of realpath() to use F_GETPATH from fcntl(2) to discover the path. ERRORS
The function realpath() may fail and set the external variable errno for any of the errors specified for the library functions alloca(3), getattrlist(2), getcwd(3), lstat(2), readlink(2), stat(2), and strdup(3). LEGACY SYNOPSIS
#include <sys/param.h> #include <stdlib.h> The include file <sys/param.h> is necessary. LEGACY DESCRIPTION
In legacy mode, the last component of file_name does not need to exist when realpath() is called. SEE ALSO
free(3), getcwd(3), compat(5) HISTORY
The realpath() function first appeared in 4.4BSD. BSD
April 5, 2008 BSD
All times are GMT -4. The time now is 07:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy