:confused: How can i rename a file 'x.log' to 'x_20020512 072909.log'
:eek: i'm using perl, with system command from a unix web server, and need to timestamp my logs if the above format (filename _ year month day hr min sec .log) (9 Replies)
Hi,
I'm not very experienced in shell scripting and that's probably why I came across the following problem:
I do have several hundred pairs of text files (PF00x.spl and PF00x.shd) where the first file (PF00x.spl) needs to be renamed according a string that is included in the second file... (12 Replies)
Hi,
I am new to Unix and i have a requirement where i need to write a shell script where i have to loop through various files present in a directory and rename them based on below criteria.
Files in the folder are in the following format. _YYYYMMDD.dat]
SDL_V1_20100530.dat... (6 Replies)
Hi,
I want to rename all the files (more than 100 files) in a fodler to another folder with date&time stamp.
foe eg,
file1.dat
file2.dat
file3.dat
..
to be renamed as
file1100629_16_30_15.txt (yy-mon-dd_hh_mi_ss)
file1100629_16_30_16.txt
..
so on (2 Replies)
Hi!
Please see our current script:
#!/usr/bin/ksh
if (egrep "This string is found in the log" /a01/bpm.log)
then
mailx -s "Error from log" me@email.com, him@email.com </a01/bpm.log
fi
To the above existing script, we need to add the following change:
1) After finding the string,... (7 Replies)
HI,
I have a file serverlist in that all host names are placed.
i have written a small script
#./testping
#! /bin/bash
for i in `cat serverlist`
do
ping $i >> output.txt
done
so now it creates a file output.txt till here fine..
now each time i run this script the output file... (4 Replies)
Hi all,
I have a many folders with zipped files in them. The zipped files are txt files from different folders. The txt files have the same names. If i try to
find . -type f -name "*.zip" -exec cp -R {} /myhome/ZIP \; it fails since the ZIP files from different folders have the same names and... (2 Replies)
Hi
I have a list a filename in a directory starting with particular pattern
for example:
abc_1234.txt
abc_7565.txt
abc_7676.txt
abc_7765.txt
i need to rename all these files by appending bck. or bck_
Expected output:
bck.abc_1234.txt
bck.abc_7565.txt
bck.abc_7676.txt... (1 Reply)
Hey guys,
I have wrote the following script to apply a module named "trinity" on my files. (it takes two input files and spit a trinity.fasta as output)
#!/bin/bash -l
#SBATCH -p node
#SBATCH -A <projectID>
#SBATCH -n 16
#SBATCH -t 7-00:00:00
#SBATCH --mem=128GB
#SBATCH --mail-type=ALL... (1 Reply)
Discussion started by: @man
1 Replies
LEARN ABOUT DEBIAN
net::sip::dtmf
Net::SIP::DTMF(3pm) User Contributed Perl Documentation Net::SIP::DTMF(3pm)NAME
Net::SIP::DTMF - DTMF RTP packet generating and extracting
SYNOPSIS
use Net::SIP::DTMF;
my $sub = dtmf_generator(
11, # event '#'
100, # duration 100ms
rfc2833_type => 101, # RTP type 101 for telephone-event/8000
# audio_type => 0, # RTP type 0 for PCMU/8000
);
while (...) {
my @pkt = $sub->($sequence,$timestamp,$srcid);
last if ! @pkt; # dtmf done
next if $buf[0] eq ''; # more coming, but no data this time (pause)
.. send @pkts ...
}
use Net::SIP::DTMF;
my $sub = dtmf_extractor(
rfc2833_type => 101, # RTP type 101 for telephone-event/8000
audio_type => 0, # RTP type 0 for PCMU/8000
);
while (...) {
if ( my ($event,$duration,$type) = $sub->($packet)) {
# event received
...
}
}
DESCRIPTION
This package provides functions for generating RTP packets containing DTMF events or extracting DTMF events from RTP packets.
FUNCTIONS
dtmf_generator ( EVENT, DURATION, %ARGS )
Generates a function which is used to generate packets for the given EVENT.
EVENT is the event numer (0..15) or undef if it should just generate silence or pause. DURATION is the time for the event in ms. ARGS
contain information how the event should be packed: either as RFC2833 RTP event or as RTP audio PCMU/8000. %ARGS can be
rfc2833_type => rtp_type
Gives the RTP payload type number for rfc2833 RTP events (telephone-event/8000). If not given will try audio_type instead.
audio_type => rtp_type
Gives the RTP payload type number for PCMU/8000. If not given and no rfc2833_type given it will croak.
volume => volume
Sets the volume for RTP event according to rfc2833.
The generated function should then be called with SEQUENCE,TIMESTAMP,SRCID to generate the RTP packets and will return @RTP_PACKETS,
with
() - DTMF event is finished
$RTP_PACKETS[0] eq '' - no RTP packet for this call (pause)
@RTP_PACKETS - RTP packets which can be send to the peer
dtmf_extractor ( %ARGS )
Generates a function which is used to extract DTMF events. Keys rfc2833_type and audio_type have the same meaning as in generate_dtmf.
It will only attempt to extract DTMF events from rfc2833 RTP events or audio if the relevant rtp_type is given.
The function will be called with the RTP packet as the only argument and will return () if no new events where found or
(EVENT,DURATION,TYPE) if an event finished, where DURATION is the duration in ms and TYPE is audio|rfc2833.
For performance reasons it is best to use only rfc2833 if the peer supports it.
perl v5.14.2 2012-06-12 Net::SIP::DTMF(3pm)