Sponsored Content
Top Forums Shell Programming and Scripting Change the content of files but not change the date Post 302745545 by ust3 on Monday 17th of December 2012 01:28:24 PM
Old 12-17-2012
Change the content of files but not change the date

I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can I do ?

thanks.

Last edited by Scott; 12-17-2012 at 02:31 PM.. Reason: Double post AFTER receiving a reply in the other thread. Tsch.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mass Change content in all files

Hi, Are there any sample scripts to change content like file paths, profile paths etc., from test version to production , instead of changing one by one, i would like to pass the in file (prod version/Test version) to convert to test or prod verions. any help is appreciated!! ~R (1 Reply)
Discussion started by: terala
1 Replies

2. Shell Programming and Scripting

how to change the content thru sed.....

Hi Everybody, Another headache form myside, i have a file name noname.txt having content as CS007=NEW and i have to write a scipt which will take the parameters as update,delete... with the 1st field of noname.txt (i.e. here CS007) whose objective is to change the 2nd field of noname.txt... (3 Replies)
Discussion started by: manas_ranjan
3 Replies

3. Shell Programming and Scripting

change field content awk

I have a line like this: I want to move HTTP/1.1 200 OK to the next line and put a blank line between the two lines i.e. How can i get it using awk? Thanks in advance (2 Replies)
Discussion started by: littleboyblu
2 Replies

4. Shell Programming and Scripting

How to change a file's content by row?

Greetings. So the question is basically the same as it's in the title. I'd like to write a program that changes a file by rows. So to clarify it. (i know i shouldn't use code,/code here but i would like to separate it) So for example a text file looks like something like this: Happy... (5 Replies)
Discussion started by: buddhist
5 Replies

5. UNIX for Advanced & Expert Users

To change the colour of the content in email sent through unix

Hi I want to change the color of the email content sent through unix. I tried a lot and left in vain. I heard that it could be done by sending the email as HTML. But I don't how to do it. Can you all share your ideas? ~sakthifire (1 Reply)
Discussion started by: sakthifire
1 Replies

6. Shell Programming and Scripting

Change file content based on data

I have a Transaction File coming into the system. In this file, in all records the relevant data is as follows- Position 1:10 -> Transaction Code Position 252:255 -> 4 digit business code Now based on these 2 fields I have to alter value in Transaction code (Position 1:10)... (6 Replies)
Discussion started by: varunrbs
6 Replies

7. Linux

when SCP, does file content change?

Good day to you all, Just want to check here, i know when scping a file, size might change due to space issue. it might sound silly, but does file content get change too? if so, what kind of situation that might be? (1 Reply)
Discussion started by: ahtat99
1 Replies

8. Shell Programming and Scripting

Change the content of files but not change the date

I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (7 Replies)
Discussion started by: ust3
7 Replies

9. Shell Programming and Scripting

Change date format in am/pm in csv files using UNIX

Hi All, I'm new to forum good to hear all. I stuck in converting date format in csv file using unix csv file contains as below ,750,0000000000000000GCJR, ,06/22/2016 14:48:44 I want to convert into as below ,750,0000000000000000GCJR, ,06/22/2016 02:48:44 PM Please reply asap..... (22 Replies)
Discussion started by: Raghureds
22 Replies

10. Shell Programming and Scripting

Script to change the file content using some conditions

Hello, I would like to change the content of the file that has few blocks starts with 10 and ends with ";" File1.txt 10 bonuses D 20 MATCHED 30 UPD COL 40 (SOL=30) 20 NOT MATCHED 30 INS COL 40 (SOL=30) ; 10 bonuses D 20 MATCHED 30 UPD COL 40... (5 Replies)
Discussion started by: Mannu2525
5 Replies
BACKUP_SETEXP(8)					       AFS Command Reference						  BACKUP_SETEXP(8)

NAME
backup_setexp - Sets the expiration date for existing dump levels. SYNOPSIS
backup setexp -dump <dump level name>+ [-expires <expiration date>+] [-localauth] [-cell <cell name>] [-help] backup se -d <dump level name>+ [-e <expiration date>+] [-l] [-c <cell name>] [-h] DESCRIPTION
The backup setexp command sets or changes the expiration date associated with each specified dump level, which must already exist in the dump hierarchy. Use the -expires argument to associate an expiration date with each dump level. When the Backup System subsequently creates a dump at the dump level, it uses the specified value to derive the dump's expiration date, which it records on the label of the tape (or backup data file). The Backup System refuses to overwrite a tape until after the latest expiration date of any dump that the tape contains, unless the backup labeltape command is used to relabel the tape. If a dump level does not have an expiration date, the Backup System treats dumps created at the level as expired as soon as it creates them. (Note that the Backup System does not automatically remove a dump's record from the Backup Database when the dump reaches its expiration date, but only if the tape that contains the dump is recycled or relabeled. To remove expired and other obsolete dump records, use the backup deletedump command.) Define either an absolute or relative expiration date: o An absolute expiration date defines the month/day/year (and, optionally, hour and minutes) at which a dump expires. If the expiration date predates the dump creation time, the Backup System immediately treats the dump as expired. o A relative date defines the number of years, months, or days (or a combination of the three) after the dump's creation that it expires. When the Backup System creates a dump at the dump level, it calculates an actual expiration date by adding the relative date to the start time of the dump operation. If the command is used to change an existing expiration date associated with a dump level, the new date applies only to dumps created after the change. Existing dumps retain the expiration date assigned at the time they were created. OPTIONS
-dump <dump level name>+ Specifies the full pathname of each dump level to assign the expiration date specified by the -expires argument. -expires <expiration date>+ Defines the absolute or relative expiration date to associate with each dump level named by the -dump argument. Absolute expiration dates have the following format: [at] {NEVER | <mm>/<dd>/<yyyy> [<hh>:<MM>] } where the optional word at is followed either by the string "NEVER", which indicates that dumps created at the dump level never expire, or by a date value with a required portion (<mm> for month, <dd> for day, and <yyyy> for year) and an optional portion (<hh> for hours and <MM> for minutes). Omit the <hh>:<MM> portion to use the default of midnight (00:00 hours), or provide a value in 24-hour format (for example, "20:30" is 8:30 p.m.). Valid values for the year range from 1970 to 2037; higher values are not valid because the latest possible date in the standard UNIX representation is in February 2038. The command interpreter automatically reduces later dates to the maximum value. Relative expiration dates have the following format: [in] [<years>y] [<months>m] [<days>d] where the optional word in is followed by at least one of a number of years (maximum 9999) followed by the letter "y", a number of months (maximum 12) followed by the letter "m", or a number of days (maximum 31) followed by the letter "d". If providing more than one of the three, list them in the indicated order. If the date that results from adding the relative expiration value to a dump's creation time is later than the latest possible date in the UNIX time representation, the Backup System automatically reduces it to that date. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The backup command interpreter presents it to the Backup Server, Volume Server and VL Server during mutual authentication. Do not combine this flag with the -cell argument. For more details, see backup(8). -cell <cell name> Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see backup(8). -help Prints the online help for this command. All other valid options are ignored. EXAMPLES
The following example associates an absolute expiration date of 10:00 p.m. on 31 December 1999 with the dump level "/1998/december": % backup setexp -dump /1998/december -expires at 12/31/1999 22:00 The following example associates a relative expiration date of 7 days with the two dump levels "/monthly/week1" and "/monthly/week2": % backup setexp -dump /monthly/week1 /monthly/week -expires 7d PRIVILEGE REQUIRED
The issuer must be listed in the /etc/openafs/server/UserList file on every machine where the Backup Server is running, or must be logged onto a server machine as the local superuser "root" if the -localauth flag is included. SEE ALSO
backup(8), backup_adddump(8), backup_deldump(8), backup_listdumps(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 BACKUP_SETEXP(8)
All times are GMT -4. The time now is 11:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy