I was wondering how I can modify this for loop, so it only loops through the filenames that do not have an ".old" extension.
for filename in $(ls "$1")
do
echo $filename | grep '\.old$' > /dev/null
if
then mv $1/$filename $1/$filename.old
fi
done (5 Replies)
Hi,
Following is my code and the file FILE_LIST_EXCESS.txt has 40 file names in it
while read LineIn
do
echo ${LineIn}
`ftp -vin << END_INPUT >> ${PID}_DS_GET_Log.log 2>&1
open servername
user userid password
cd FileDir
get ${LineIn}
END_INPUT`... (4 Replies)
I have 2 files one of them has all the all mac addresses and the other one has all the ip addresses. Basically, I want to loop thru those 2 files and generate a configuration like below:
host www184.domain.com {
hardware ethernet 00:13:72:3B:B4:3A;
fixed-address 192.168.0.184;
}... (4 Replies)
function ext
{
echo "THANKS & WELCOME BACK"
}
function upc
{
echo "TO EXPORT UPROC GIVE UPROC NAME PER LINE IN THE input.txt and PRESS Y"
echo "TO GO BACK PRESS 99"
read parm0
if ;
then
start
elif ;
then
for i in `cat input.txt` ; do
echo $i
$UXEXE/uxext upr upr=$i... (0 Replies)
Hi, my script is waiting for 3 files to come to a folder for 30 min but even when all the files arrive in the folder it's still waiting for these three files. Files can come with in 2 min and I want it to start processing them immediately after all the files arrive in the folder.
until ; do... (3 Replies)
sup experts..i had a script which was bugging me..was hoping someone could point out the issue here
Input file: space separated 2 columns
I wanted to print out the 2 columns after assigning them to variables ( bascially the same output but iterate through line by line ). The code worked... (7 Replies)
Hi,
I am trying to move a file from remote server to local server and when the transfer completes successfully i call a script in remote server to remove the file which was successfully transferred.
I do this by first getting the list of file in remote server and move the text file to local... (8 Replies)
Hi,
i=0
t5=6000001
while
do
i=`expr $i + 1`
t5=`expr $t5 + 1`
echo $t5
done
I am able to increment "col3" value but unable to get col1,col2 value.
Input:
t1=10001
t2=abc
t3=ghkc (5 Replies)
Hi,
I have prepared a script to search for backup file information on the Linux server. Script works fine for the most part except the echo statement inside an IF conditional block displays the message ''snapshot directory not found on xxxxx" even though the .snapshot directory is found a... (11 Replies)
Hi Team,
I have for loop in my shell script. Which basically loop through all files in the directory, When some files are in the directory it works just fine.
But if there are no files at all..still the for loop try to execute. Please help. Below is the code.
#!/bin/ksh
echo "Program... (5 Replies)
Discussion started by: bharath561989
5 Replies
LEARN ABOUT DEBIAN
io::async::timer::absolute
IO::Async::Timer::Absolute(3pm) User Contributed Perl Documentation IO::Async::Timer::Absolute(3pm)NAME
"IO::Async::Timer::Absolute" - event callback at a fixed future time
SYNOPSIS
use IO::Async::Timer::Absolute;
use POSIX qw( mktime );
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my @time = gmtime;
my $timer = IO::Async::Timer::Absolute->new(
time => mktime( 0, 0, 0, $time[4]+1, $time[5], $time[6] ),
on_expire => sub {
print "It's midnight
";
$loop->stop;
},
);
$loop->add( $timer );
$loop->run;
DESCRIPTION
This subclass of IO::Async::Timer implements one-shot events at a fixed time in the future. The object waits for a given timestamp, and
invokes its callback at that point in the future.
For a "Timer" object that waits for a delay relative to the time it is started, see instead IO::Async::Timer::Countdown.
EVENTS
The following events are invoked, either using subclass methods or CODE references in parameters:
on_expire
Invoked when the timer expires.
PARAMETERS
The following named parameters may be passed to "new" or "configure":
on_expire => CODE
CODE reference for the "on_expire" event.
time => NUM
The epoch time at which the timer will expire.
Once constructed, the timer object will need to be added to the "Loop" before it will work.
Unlike other timers, it does not make sense to "start" this object, because its expiry time is absolute, and not relative to the time it is
started.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::Timer::Absolute(3pm)