Sponsored Content
Full Discussion: Renaming Files With 2 .
Top Forums UNIX for Dummies Questions & Answers Renaming Files With 2 . Post 302644809 by neutronscott on Tuesday 22nd of May 2012 12:39:28 PM
Old 05-22-2012
did you use sh again instead of ksh ?

sh, tho i don't like it

Code:
for br in *.rpt; do
        id1=${br##*_COB_}
        id2=${id1%.rpt}
        id2=${id2##*_}
        id1=${id1%%_*}
        bd=$( echo cob*${id1}*.0${id2}.* )
        [ -f "$bd" ] || continue
        echo mv "$br" "$bd.br"
        echo mv "$bd" "$bd.bd"
done

This User Gave Thanks to neutronscott For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

renaming files

i have a set of *.lst files. now i want to change the names from "lst" to "dat". how to do it? ex.: -rw-r--r-- 1 rram group 22 Sep 21 13:10 a.lst -rw-r--r-- 1 rram group 22 Sep 21 13:09 b.lst -rw-r--r-- 1 rram group 22 Sep 21 13:10 c.lst... (4 Replies)
Discussion started by: raguramtgr
4 Replies

2. UNIX for Dummies Questions & Answers

renaming the files

Hi All, Today I got a small problem while handling zipped files in PROD support. There are files in this format and I had to grep them reading some contents A.B.gz.C.D where A,B,C and D stand for variables (like FIRST.NAME.gz.MIDDLE.LAST). I know that these files are zipped files and If I... (1 Reply)
Discussion started by: adurga
1 Replies

3. UNIX for Dummies Questions & Answers

renaming files

directory name = /usr/tom/1997 files - ABC_1997_ST1_BCD.SQL BCD_1997_ST1_EFG_SAB.SQL TTT_EBC_1997_ST1_A.SQL sub directory - /usr/tom/1997/jan a) I want to just rename the all files ending with '.SQL' and also its contents in the 1997 directory(excluding subdirectories eg... (3 Replies)
Discussion started by: systemsb
3 Replies

4. UNIX for Dummies Questions & Answers

Renaming files

Hello! I am not familiar with UNIX and I have this problem: I need to move files from a UNIX machine to a PC. UNIX file names contain ":" as special character which is not recognized in a PC. How can I change ":" for "_" in the name of a bunch of files in UNIX? Thanks for your help. (7 Replies)
Discussion started by: Tygoon
7 Replies

5. UNIX for Dummies Questions & Answers

renaming files

I have a list of files named ab_*.csv I would like to remane them all by removing the ab_ and have *.csv I did the following but I am surely missing something. /* wrong script */ for i in `ls -1 ab_*`; do mv ab_$i $i; done Thanks in advance. (1 Reply)
Discussion started by: jxh461
1 Replies

6. Shell Programming and Scripting

renaming files

Hi all, using a utility image file was named starting with blank space and a blank space in between. I want to rename the files. file names are in the format " sb 12.tif"," sb 13.tif"," sb 14.tif" the files are in thousands. i want to rename as 12.tif, 13.tif, 14.tif.... thanks. (3 Replies)
Discussion started by: ahkverma
3 Replies

7. Shell Programming and Scripting

renaming files or adding a name in the beginning of all files in a folder

Hi All I have a folder that contains hundreds of file with a names 3.msa 4.msa 21.msa 6.msa 345.msa 456.msa 98.msa ... ... ... I need rename each of this file by adding "core_" in the begiining of each file such as core_3.msa core_4.msa core_21.msa (4 Replies)
Discussion started by: Lucky Ali
4 Replies

8. Shell Programming and Scripting

renaming files

Hi, I have a list of files in a folder with the same name ending (over 1000 files) joe.jpy.jpeg joe1.jpy.jpeg joe2.jpy.jpeg jon3.jpy.jpeg jor5.jpy.jpeg .....jpy.jpeg etc. I want to change jpy to hhk So the output will be: joe.hhk.jpeg joe1.hhk.jpeg joe2.hhk.jpeg jon3.hhk.jpeg... (3 Replies)
Discussion started by: kylle345
3 Replies

9. Shell Programming and Scripting

Renaming files

Hello, I am looking for a command line that will rename name files : f700_abc_o_t_MASTERID_AS_AE_20130323.csv like this f700_abc_o_t_MASTERID_AS_AE_20130324.csv The great idea could be to get the date stamp 20130323 and change any part of it, instead of just change the... (4 Replies)
Discussion started by: Aswex
4 Replies

10. Shell Programming and Scripting

Renaming multiple files in sftp server in a get files script

Hi, In sftp script to get files, I have to rename all the files which I am picking. Rename command does not work here. Is there any way to do this? I am using #!/bin/ksh For eg: sftp user@host <<EOF cd /path get *.txt rename *.txt *.txt.done ... (7 Replies)
Discussion started by: jhilmil
7 Replies
ICNCTRL(8)						    Linux System Administration 						ICNCTRL(8)

NAME
icnctrl - configure ICN ISDN adaptor SYNOPSIS
icnctrl [-d Driver-Id] action options ... DESCRIPTION
icnctrl is used to setup the ICN ISDN device driver and for downloading the firmware into the ISDN card. The use of icnctrl makes sense, if you are using an ICN card only. OPTIONS
-d Driver-Id selects the S0 interface named by Driver-Id. Driver-Ids are defined during driver initialisation. See icn(4) for a description of the syntax to be used for modularised and monolithic driver versions. This option must be used to identify the S0 interface if more than one S0 interface is existent. If a single ICN-2B is used, it may be omitted. If using more than one card, support for the other cards is enabled with the add action of icnctrl. Ids may not start with digits or small x, because these values are misinter- preted as numeric parameters by insmod. For loading the module, always the newest modutils package should be used to avoid problems during load. The following actions may be given to icnctrl. add port [id1 [id2]] enables support for an additional card in the driver. If id1 and id2 are missing, adds an ICN-2B with an id given by the system. with id2 missing, adds an ICN-2B with an Id given by the user. With both Ids given, adds an ICN-4B with both Ids given by the user. There is no checking against port-conflicts. Ports are checked later during first activation while downloading the firmware and can be changed at runtime. Ids are checked against conflicts, and if a conflict happens, replaced by the system in the same manner as if no Id was supplied. It is not allowed, to add cards, after a load was done. io [base-address port] sets the address of the memory-mapped IO-region and the port-base. After loading the icn-module into kernel-space, this command should be used as the very first setup, if the hardware settings are different from the default settings below. If both parameters are omitted, prints out current settings. The default memory address is 0xD0000, the default port-base is 0x320. An ICN card uses 4 port-addresses. The memory address is globally used for all cards (cards are mapped on demand), while each card has its own port range. Memory range is 16k. leased on|1|2|off switches between normal (dialup) and leased-line mode. Leased-line mode is intended for usage with S64K-lines or - if both channels are used - for S02. If the second parameter is 1 , only one channel is enabled. If the second parameter is 2 or on both channels are enabled. Leased lines do not have a D-channel. When leased-line mode is enabled, the driver simulates incoming calls using spe- cial "phone-numbers" for calling and called address which are generated as follows: Calling number: LEASEDx where x is the internal slot-number of the S0 interface. This number starts with 0 for the first S0 interface and is incremented by one for every S0 interface configured using the add action. Called number: x where x is equal to the channel number of the calling S0 interface starting with 1. load boot-code firmware [firmware2] downloads the firmware into the card and starts operation. Using this command, after loading the icn-module into kernel-space the first real access to the hardware is done. Therefore the io action above, should be used before, if the hardware settings are dif- ferent from the default settings. Usually the images are located in @DATADIR@. The boot-code is named loadpg.bin. The firmware depends on the D-channel protocol of the ISDN line. For German 1TR6-lines, the firmware is named pc_1t_ca.bin. For Euro-ISDN-lines, it is named pc_eu_ca.bin. When loading an ICN-4B, two firmware parameters have to be supplied. The first firmware is used for the upper S0 connector, the second firmware is used for the lower S0 connector (towards the card's slot connector). dump is available if the program is configured using the --enable-dump option only. The contents of internal driver variables is dumped on stdout. FILES
@DATADIR@/loadpg.bin This is the image of the bootstrap loader, which is loaded first, then loads the firmware into the card's memory and starts execu- tion. @DATADIR@/pc_1t_ca.bin This is the image of the firmware designed for the German 1TR6 protocol. @DATADIR@/pc_eu_ca.bin This is the image of the firmware, designed for Euro ISDN. DIAGNOSTICS
The following diagnostics may be issued on stderr: Read error on boot-code The file supplied as boot-code has less than 4096 bytes length or could not be read. Read error on firmware The file supplied as firmware has less than 65536 bytes length or could not be read. BUGS
No bugs so far. AUTHOR
(C) 1997 by Fritz Elfert <fritz@isdn4linux.de> SEE ALSO
isdnctrl(8), icn(4), isdnctrl(4), ttyI(4). isdn4k-utils-3.1pre4 1999/09/06 ICNCTRL(8)
All times are GMT -4. The time now is 08:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy