Sponsored Content
Full Discussion: Rename all files at a time
Top Forums Shell Programming and Scripting Rename all files at a time Post 302785555 by saurau on Tuesday 26th of March 2013 01:17:54 AM
Old 03-26-2013
Hello hanson44,

It's not working Smilie

Below is my output:
Code:
[root@dhcppc116 files]# ls
appp1.APP.RTP.DEV1  appp2.APP.RTP.DEV1  appp3.APP.RTP.DEV1
[root@dhcppc116 files]# rename 's/RTP/mmk' *.DEV1
[root@dhcppc116 files]# ls
appp1.APP.RTP.DEV1  appp2.APP.RTP.DEV1  appp3.APP.RTP.DEV1
[root@dhcppc116 files]# 

[root@dhcppc116 ~]# uname -a
Linux dhcppc116 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386 GNU/Linux

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to rename files?

: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)
Discussion started by: CompuTelSystem
9 Replies

2. Shell Programming and Scripting

Rename files

Hi, I wanna rename bunch of files which has ":" to -. ie. rename file named file1:file1 to file1-file1. any ideas? (2 Replies)
Discussion started by: linuxaddict7
2 Replies

3. Shell Programming and Scripting

rename files Ax based on strings found in files Bx

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)
Discussion started by: inCH
12 Replies

4. Shell Programming and Scripting

Rename files

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)
Discussion started by: bishoo
6 Replies

5. Linux

rename files in a folder with date&time stamp

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)
Discussion started by: feroz
2 Replies

6. Shell Programming and Scripting

If(Condition) Rename a file with (Date+Time) Stamp

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)
Discussion started by: atechcorp
7 Replies

7. Shell Programming and Scripting

Need bash script to ping the servers and rename the output file each time the script is ran

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)
Discussion started by: madhudeva
4 Replies

8. Shell Programming and Scripting

Script to unzip files and Rename the Output-files

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)
Discussion started by: pmkenya
2 Replies

9. Shell Programming and Scripting

How to rename all files at a time by appending some characters at the begining?

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)
Discussion started by: Little
1 Replies

10. Shell Programming and Scripting

SBATCH trinity for multiple files and rename/move the output files

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
Net::SIP::Endpoint(3pm) 				User Contributed Perl Documentation				   Net::SIP::Endpoint(3pm)

NAME
Net::SIP::Endpoint - Endpoint for SIP packets (UAC,UAS) SYNOPSIS
my $disp = Net::SIP::Dispatcher->new(...); my $ua = Net::SIP::Endpoint->new($disp); $ua->register( from => 'sip:me@example.com', contact => 'sip:me@192.168.0.1', registrar => '192.168.0.10:5060' ); DESCRIPTION
The package implements a communication endpoint for SIP. This is usually a phone, but can also be a stateful proxy (because it retransmits packets itself). It provides methods to send arbitrary requests but also for sending special requests like INVITE or REGISTER. Together with Net::SIP::Endpoint::Context it implements the behavior of the endpoint. For incoming requests the endpoint usually communicates with the upper layer, the application, which is the interface to the user (e.g. let it ring for incoming calls, create response for call accepted if user picks up phone on incoming call etc). CONSTRUCTOR
new ( DISPATCHER ) Creates a new endpoint and sets it as the receiver for incoming packets at the Net::SIP::Dispatcher DISPATCHER. The endpoint will use DISPATCHER for outgoing packets and will receive incoming packets from it. METHODS
set_application ( APP ) Sets APP as the upper layer, e.g. the layer between the user and the endpoint object $self. APP is either an object which has a method receive or a callback usable by invoke_callback in Net::SIP::Util. The callback will be invoked with the following arguments: ENDPOINT This is the endpoint itself, e.g. $self. CTX The Net::SIP::Endpoint::Context object for the current call. REQUEST The Net::SIP::Request which caused the invocation of the call, e.g. an INVITE on new calls, ACK if the peer established the call, BYE if a call gets closed by the peer etc. LEG The Net::SIP::Leg object where the call came in. Together with FROM used to send response packet back to peer. FROM "ip:port" of the sender of the request. It will call into APP in various incoming requests, like: INVITE In this case APP should ring the user and while ringing send "180 Ringing" responses back to the peer, using "ENDPOINT->new_response". After some time it should send a final response (like "200 Ok" if the user accepted the call). ACK This is the sign, that the peer established the call. APP should now expect to process incoming RTP data and send RTP data itself. CANCEL, BYE This informs APP, that the call is closed. No need for the APP to send a response itself, this was already handled by the endpoint (because there is no choice of responses, it can hardly not accept a BYE). other requests Like OPTION,.. . Theseneed to be fully handled by APP, e.g. send the appropriate response back using "ENDPOINT->new_response". invite ( CTX, [ CALLBACK, BODY, %ARGS ] ) Creates a new INVITE request and delivers it to the peer. Simply calls new_request with the method 'INVITE'. See this method for information for the arguments. register ( %ARGS ) Registers endpoint at remote registrar. %ARGS needs to be filled as follows: registrar "ip:port" of registrar. Mandatory. from The address to register at the registrar. Mandatory. contact The contact, under which "from" will be registered. Mandatory. auth Authorization info, see method authorize in Net::SIP::Request for information about the format. Optional. expires Expires time. Optional, defaults to 900. callback Optional callback, e.g. called if requests come in from the peer on the call created for the registration. See invoke_callback in Net::SIP::Util for the format. All other keys will be used as header keys in generating the Net::SIP::Request object. new_request ( METHOD, CTX, [ CALLBACK, BODY, %ARGS ] ) Method is the uppercase name of the method for which a request should be generated. It can also be already a Net::SIP::Request object in which case no new request object will be generated, but the provided delivered. CTX is either an existing Net::SIP::Endpoint::Context object or a hash reference which will be used to construct one. It contains information about "from" and "to" etc. See constructor in Net::SIP::Endpoint::Context for details. In case of a hash reference auth and callid from ARGS will be used for the newly constructed context. If it is an existing CTX it has to be one which is already managed by this endpoint (e.g. one returned by this method), the endpoint will only manage CTX which it created itself so that a context cannot be shared between multiple endpoints. CALLBACK is a callback usable by invoke_callback in Net::SIP::Util. If defined it will be set up as the new default callback for the context. BODY is a string or an object for the SIP body accepted by the constructor of Net::SIP::Request. See there. If a response object is given as resp40x in ARGS it will be used to authorize the newly created request. Anything else in %ARGS will be used to construct the SIP header. See constructor in Net::SIP::Request. It returns the Net::SIP::Endpoint::Context object for this request which can be then used for further requests in the same call. cancel_invite ( CTX, REQUEST, CALLBACK ) Cancel the given request within the given context (e.g send CANCEL request). If no REQUEST is given it will cancel the most recent INVITE. Returns the number of requests canceled, e.g. 0 or 1. CALLBACK will be used as the callback for the CANCEL request it sends using new_request. close_context ( CTX ) Delete Net::SIP::Endpoint::Context object CTX from the list of active calls. receive ( PACKET, LEG, FROM ) Called from dispatcher on incoming packets. PACKET is the incoming Net::SIP::Packet, LEG the Net::SIP::Leg where the packet came in and FROM the "ip:port" of the sender. Just forwards to receive_request or receive_response based on the type of packet. receive_response ( RESPONSE, LEG, FROM ) Handles incoming response packets. Tries to find an active call based on the "Call-Id" header in the packet. If none was found it will drop the packet, otherwise call handle_response on the call context object (Net::SIP::Endpoint::Context). receive_request ( REQUEST, LEG, FROM ) Handles incoming requests. If there is already a call context for this Call-Id in the request it will use it, otherwise it will create a Net::SIP::Endpoint::Context object based on the information in the request ("from", "to", "contact",... ). Calls handle_request on the existing/new context object. new_response ( CTX, RESPONSE, LEG, ADDR ) Delivers Net::SIP::Response packet RESPONSE through the endpoints dispatcher to ADDR ("ip:port") using Net::SIP::Leg LEG. LEG and ADDR are usually the leg and the senders address where the associated request came in. CTX is the context from the call, where the associated request came in. If the response is a 2xx response to a INVITE and no "contact" header is given as required from the RFC it will add one based on the CTX. perl v5.14.2 2012-06-26 Net::SIP::Endpoint(3pm)
All times are GMT -4. The time now is 06:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy