10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
To delete log files content older than 30 days and append the lastest date log file date in the respective logs
I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs
This is my script
cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
My requirement is to append a date in format DDMMYYYYHHMISS at the end of first line of file which is HEADER. I am trying command
sed -i '1s/.*/&<date_format>/' <file_name>
Where <date_format>=`date +%m%d%Y%H%M%S`
I am somehow misisng the right quotes ti get this added in above... (2 Replies)
Discussion started by: sanjaydubey2006
2 Replies
3. UNIX for Dummies Questions & Answers
Hi ,
I have a file with a running sequence number. I need to append a date value mmdd format on to the first column.
for e.g.: The file contains records as
001 abc
002 cde
003 edf
004 fgh
005 hik
The output should be
1111001 abc
1111002 cde
1111003 edf
1111004 ... (1 Reply)
Discussion started by: kalyansid
1 Replies
4. Shell Programming and Scripting
I'm new to shell scripting and am writing a script to help me log the free memory and hd space on a server. As of now, the script just runs 'df -h' and appends the output to a file and then runs 'top' and appends the output to a log file.
What I want to do, is have the script also search the... (3 Replies)
Discussion started by: enator45
3 Replies
5. UNIX for Dummies Questions & Answers
Hi
Am having issue on appending time stamp
I know the exact file names in the directory like
a.dat
b.dat
c.dat
e.dat
f.dat
I want to read all these file names and append the timestamp to each files like
a.dat.20090604,b.dat.20090604 and move to the different directory.
... (3 Replies)
Discussion started by: bobprabhu
3 Replies
6. UNIX for Dummies Questions & Answers
Hi
I have the data file in the one directory and i have to copy the file in the another directory with the timestamp.
EX:
/ab/cd/a.dat i need to copy this file to the another directory /ef/gh/.
while am copying i need to append the current timestamp in the file like... (3 Replies)
Discussion started by: bobprabhu
3 Replies
7. Shell Programming and Scripting
I have file called xx
Now i want to rename this file as xxYYYYMMDD_HHMIAM.xls
Here is my code..
export DATE1=`date +%Y%m%d`
mv xx xx$DATE1
This code renames as xxYYYYMMDD
Now how can i append HHMIAM at the end of the file?
Any help is appreciated... (3 Replies)
Discussion started by: govindts
3 Replies
8. Shell Programming and Scripting
hi All,
Searched forum but couldn't find a solution to this problem:
How can I append a file with date in the ninth line?
ie I want to insert a line with the current date and time in the ninth line.
I tried this:
date=`date`
awk 'NR==9 {printf "'$date' \n"} {print $0}' abc.log
below... (10 Replies)
Discussion started by: Sreejith_VK
10 Replies
9. Shell Programming and Scripting
hi
i need to rename a.txt to a_12052008.txt using the batch file
i used reanme a.txt a_%date%.txt ......but its done nothing
am using win2000 professional edition.
system date format is : The current date is: Mon 2008-05-12
can anyone help me to rename
thanks
aemu (5 Replies)
Discussion started by: aemunathan
5 Replies
10. Shell Programming and Scripting
Hi,
I'm trying to accomplish the following and would like some suggestions or possible bash script examples that may work
I have a directory that has a list of log files that's periodically dumped from a script that is crontab that are rotated 4 generations. There will be a time stamp that is... (4 Replies)
Discussion started by: primp
4 Replies