Search Results

Search: Posts Made By: ashly
1,997
Posted By ashly
Hi guys, I attached 2 codes and 2 outputs as...
Hi guys,

I attached 2 codes and 2 outputs as below:

Code 1:

find $InputPath -type f -mtime +40 | sed "s/^/[`date +'"'%Y-%m-%d %T'"'`] /" | tee -a $LogPath/$LogFile


Output 1:
...
1,997
Posted By ashly
Hi Ranga, I removed the extra single quote....
Hi Ranga,

I removed the extra single quote. But error still occurred:

[2013-01-17 17:47:55] ---------------
./ArchiveFile_01.sh[9]: ]/: not found.
sed: 0602-404 Function s/^/[2013-01-17...
1,997
Posted By ashly
Hi Ranga, Full code as below: ...
Hi Ranga,

Full code as below:

#!/bin/ksh

LogPath=/usr
LogFile=achieve.log

InputPath=/usr/temp

echo [`date +"%Y-%m-%d %T"`] "---------------" | tee -a $LogPath/$LogFile
find...
1,997
Posted By ashly
Hi Ranga, I tried but I got the error below:...
Hi Ranga,

I tried but I got the error below:

sed: 0602-404 Function s/^/'[2013-01-17 cannot be parsed.
1,997
Posted By ashly
Hi, Current output as below: ...
Hi,

Current output as below:

[2013-01-17 16:53:02]---------------
filename1
filename2
[2013-01-17 16:53:02]---------------


Desirable output:

[2013-01-17 16:53:02]---------------...
1,997
Posted By ashly
Hi, Is this the correct syntax? echo...
Hi,

Is this the correct syntax?


echo [`date +"%Y-%m-%d %T"`] "---------------" | tee -a $LogPath/$LogFile
find $InputPath -type f -mtime +30 | tee -a $LogPath/$LogFile
echo [`date...
1,997
Posted By ashly
Capture listed files from find command
Hi all,

I am using command
find $InputPath -type f -mtime +30

However, I need to capture the file listed in screen.
May I know how to achieve this?


Thank you.
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 11:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy