Sponsored Content
Full Discussion: Find & Replace
Top Forums UNIX for Dummies Questions & Answers Find & Replace Post 302742773 by rob171171 on Tuesday 11th of December 2012 02:18:59 PM
Old 12-11-2012
Find & Replace

Hi
I am looking to rename the contents of this dir, each one with a new timestamp, interval of a second for each so it the existing format is on lhs and what I want is to rename each of these to what is on rhs..hopefully it nake sense

Code:
CDR.20060505.150006.gb    CDR.20121211.191500.gb
CDR.20060505.150109.gb    CDR.20121211.191501.gb
CDR.20060505.150216.gb    CDR.20121211.191502.gb
CDR.20060505.150308.gb    CDR.20121211.191503.gb

Hopefully this makes sense.
I know I need to utilise a sed command in conjunction with some sort of loop

Last edited by rob171171; 12-11-2012 at 03:20 PM.. Reason: more detail
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find & Replace

I get a text file with 70+ columns (seperated by Tab) and about 10000 rows. The 58th Column is all numbers. But sometimes 58th columns has "/xxx=##" after the numeric data. I want to truncate this string using the script. Any Ideas...:confused: (3 Replies)
Discussion started by: gagansharma
3 Replies

2. UNIX for Dummies Questions & Answers

improving my script (find & replace)

Hi all, I have a script that scan files, find old templet and replace it with new one. #!/bin/ksh file_name=$1 old_templet=$2 new_templet=$3 # Loop through every file like this for file in file_name do cat $file | sed "s/old_templet/new_templet/g" > $file.new #do a global searce and... (8 Replies)
Discussion started by: amir_yosha
8 Replies

3. Shell Programming and Scripting

find & incremental replace?

Looking for a way using sed/awk/perl to replace port numbers in a file with an incrementing number. The original file looks like... Host cmg-iqdrw3p4 LocalForward *:9043 localhost:9043 Host cmg-iqdro3p3a LocalForward *:10000 localhost:10000 Host cmg-iqdro3p3b LocalForward... (2 Replies)
Discussion started by: treadwm
2 Replies

4. UNIX for Dummies Questions & Answers

Find, Replace & Edit a string?

Is this something SED would be used for or can AWK do it? I have a string that I would like to chop bits out of and re-arrange some of the rest. Basically I want to change this: <log4j:event logger="webserver" timestamp="1240110840109" time="Sun Apr 19 04:14:00 BST 2009" level="INFO"... (4 Replies)
Discussion started by: Sepia
4 Replies

5. Shell Programming and Scripting

find & replace with user input

Trying to create a script/executable to replace "abc" text string in "myfile.htm" with input from a pop-up field. For example, launch this thing and a prompt is popped up asking the user to input what "abc" should be replaced with, then it inserts what the user inputs in place of abc in the... (3 Replies)
Discussion started by: mike909
3 Replies

6. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

7. Shell Programming and Scripting

Find & replace --> create a new file

Hi All, I have a unix shell script file as below. My task is a)to replace 248 to 350 and need to create a new file as BW3_350.sh b)to replace 248 to 380 and need to create a new file as BW3_380.sh c)to replace 248 to 320 and need to create a new file as BW3_320.sh there is no... (6 Replies)
Discussion started by: karthi_mrkg
6 Replies

8. UNIX for Dummies Questions & Answers

GREP Find & Replace <p class>

I am making an eBook. I am editing the html in BBedit. I need to replace all <p class="s5"> with just a <p>. How do I write this for GREP? Thank you, Abby (5 Replies)
Discussion started by: cuddlykitty
5 Replies

9. UNIX for Dummies Questions & Answers

Perl find & replace - what am I doing wrong?

Hi! I have a directory full of .plist type files from which I need to delete a line. Not every file contains the line, but of course I'd like to do it recursively. The line which I want to delete is: <string>com.apple.PhotoBooth</string> and looks like this in its native habitat: ... (9 Replies)
Discussion started by: sudon't
9 Replies

10. UNIX for Dummies Questions & Answers

Find & Replace with same case letters

I have text with upper and lower case words. I want to find something and replace it with something new. But it should match the case - Meaning - it should replace old upper cased word with NEW upper case word and lower with lower. example: this text is very simple TEXT. now I want to replace... (5 Replies)
Discussion started by: grep_me
5 Replies
ata(7D) 							      Devices								   ata(7D)

NAME
ata - AT attachment disk driver SYNOPSIS
ide@unit-address DESCRIPTION
The ata driver supports disk and ATAPI CD/DVD devices conforming to the AT Attachment specification including IDE interfaces. Support is provided for both parallel ATA (PATA) and serial ATA (SATA) interfaces. Refer to the Solaris x86 Hardware Compatibility List for a list of supported controllers. PRECONFIGURE
A PCI IDE controller can operate in compatibility mode or in PCI-native mode. If more than one controller is present in the system, only one can operate in compatibility mode. If two PATA drives share the same controller, you must set one to master and the other to slave. If both a PATA disk drive and a PATA CD- ROM drive utilize the same controller, you can designate the disk drive as the master with the CD-ROM drive as the slave, although this is not mandatory. Supported Settings Supported settings for the primary controller when in compatibility mode are: o IRQ Level: 14 o I/O Address: 0x1F0 Supported settings for the secondary controller when in compatibility mode are: o IRQ Level: 15 o I/O Address: 0x170 Note - When in PCI-native mode, the IRQ and I/O address resources are configured by the system BIOS. Known Problems and Limitations o This driver does not support any RAID features present on a PATA/SATA controller. As a result, you should configure BIOS to select IDE mode rather than RAID mode. Some systems may require updating BIOS to allow switching modes. o On some systems, the SATA controller must have option ROM enabled or BIOS will not consider SATA drives as bootable devices. o Panasonic LK-MC579B and the Mitsumi FX34005 IDE CD-ROM drives are not supported and cannot be used to install the Solaris operating environment. o CMD-604 is unable to handle simultaneous I/O on both IDE interfaces. This defect causes the Solaris software to hang if both inter- faces are used. Use only the primary IDE interface at address 0x1F0. o The Solaris Volume Management software does not work with the Sony CDU-55E CD-ROM drive whether configured as device 0 or 1 (master or slave). Comment out the following line in the /etc/vold.conf file to prevent vold from hanging the controller: # use cdrom drive /dev/rdsk/c*s2 dev_cdrom.so cdrom%d o NEC CDR-260/CDR-260R/CDR-273 and Sony CDU-55E ATAPI CD-ROM drives might fail during installation. o Sony CDU-701 CD-ROM drives must be upgraded to use firmware version 1.0r or later to support booting from the CD. CONFIGURATION
The ata driver properties are usually set in ata.conf. However, it may be convenient, or in some cases necessary, for you to set some of the DMA related properties as a system global boot environment property. You set or modify properties in the boot environment immediately prior to booting the Solaris kernel by pressing ESC when prompted for the Solaris device configuration assistant. You can also set boot environment properties using the eeprom(1M) command or by editing the bootenv.rc configuration file. If a property is set in both the driver's ata.conf file and the boot environment, the ata.conf property takes precedence. Property modification other than with DCA are not effective until you reboot the system. If booting from hard disk or floppy disk, any property changes made with DCA will persist across future boots. If you boot from a CD/DVD, property changes persist to the installed tar- get drive, but not to a subsequent boot of the CD/DVD. Direct Memory Access is enabled by default for disks and disabled for ATAPI CD/DVD devices. If you are trying to enable DMA when booting from a CD/DVD, you must first set atapi-cd-dma-enabled to '1' using the DCA. ata-dma-enabled This property is examined before the DMA properties discussed below. If it is set to '0,' DMA is disabled for all ATA/ATAPI devices, and no further property checks are made. If this property is absent or is set to '1,' DMA status is determined by further examining one of the other properties listed below. ata-disk-dma-enabled This property is examined only for ATA disk devices, and only if ata-dma-enabled is not set to '0.' If ata-disk-dma-enabled set to '0,' DMA is disabled for all ATA disks in the system. If this property is absent or set to '1,' DMA is enabled for all ATA disks and no further property checks are made. If needed, this property should be created by the administrator using the DCA or the eeprom(1M) command. atapi-cd-dma-enabled This property is examined only for ATAPI CD/DVD devices, and only if ata-dma-enabled is not set to '0.' If atapi-cd-dma-enabled is absent or set to '0,' DMA is disabled for all ATAPI CD/DVD's. If set to '1,' DMA is enabled and no further property checks are made. The Solaris installation program creates this property in the boot environment with a value of '0.' It can be changed with the DCA or eeprom(1M) as shown in the Example section of this manpage. atapi-other-dma-enabled This property is examined only for non-CD/DVD ATAPI devices such as ATAPI tape drives, and only if ata-dma-enabled is not set to '0.' If atapi-other-dma-enabled is set to '0,' DMA is disabled for all non-CD/DVD ATAPI devices. If this property is absent or set to '1,' DMA is enabled and no further property checks are made. If needed, this property should be created by the administrator using the DCA or the eeprom(1M) command. drive0_block_factor drive1_block_factor ATA controllers support some amount of buffering (blocking). The purpose is to interrupt the host when an entire buffer full of data has been read or written instead of using an interrupt for each sector. This reduces interrupt overhead and significantly increases throughput. The driver interrogates the controller to find the buffer size. Some controllers hang when buffering is used, so the values in the configuration file are used by the driver to reduce the effect of buffering (blocking). The values presented may be chosen from 0x1, 0x2, 0x4, 0x8 and 0x10. The values as shipped are set to 0x1, and they can be tuned to increase performance. If your controller hangs when attempting to use higher block factors, you may be unable to reboot the system. For x86 based systems, it is recommended that tuning be performed using a duplicate of the /platform/i86pc/kernel directory subtree. This ensures that a bootable kernel subtree exists in the event of a failed test. ata-revert-to-defaults revert--<diskmodel> When rebooting or shutting down, the driver can set a feature which allows the drive to return to the power-on settings when the drive receives a software reset (SRST) sequence. If this property is present and set to 1, the driver will set the feature to revert to defaults during reset. Setting this property to 1 may prevent some systems from soft-rebooting and would require cycling the power to boot the system. If this property is not present the system will not set the feature to revert to defaults during reset. To determine the string to substitute for <diskmodel>, boot your system (you may have to press the reset button or power-cycle) and then view /var/adm/messages. Look for the string "IDE device at targ" or "ATAPI device at targ." The next line will contain the word "model" followed by the model number and a comma. Ignore all characters except letters, digits, ".", "_", and "-". Change uppercase letters to lower case. If the string revert-<diskmodel> is longer than 31 characters, use only the first 31 characters. EXAMPLES
Example 1: Sample ata Configuration File # for higher performance - set block factor to 16 drive0_block_factor=0x1 drive1_block_factor=0x1 max_transfer=0x100 flow_control="dmult" queue="qsort" disk="dadk" ; Example 2: Revert to defaults property revert-st320420a=1; Output of /var/adm/messages: Aug 17 06:49:43 caesar ata:[ID 640982 kern.info] IDE device at targ 0, lun 0 lastlun 0x0 Aug 17 06:49:43 caesar ata:[ID 521533 kern.info] model ST320420A, stat Example 3: Change DMA property within Solaris DCA To change one of the DMA properties within the Solaris Device Configuration Assistant: 1. Run the Solaris (x86 Edition) Device Configuration Assistant by pressing ESC when prompted soon after booting. 2. Press F2_Continue to scan for devices. 3. Press F2_Continue to display a list of boot devices on the Boot Solaris menu. 4. Go to the View/Edit Property Settings menu. 5. Press F4_Boot Tasks, select View/Edit Property Settings, and press F2_Continue. 6. Select the property from the list and press F3_Change. 7. Type 0 or 1 and press F2_Continue. 8. Press F2_Back to return to the Boot Tasks menu. 9. Press F3_Back to return to the Boot Solaris menu. 10. Select the device from which you want to boot and press F2_Continue. Example 4: Change DMA Property with eeprom(1M) To enable DMA for optical devices while the Solaris kernel is running with the eeprom(1M) system command: eeprom 'atapi-cd-dma-enabled=1' FILES
/platform/i86pc/kernel/drv/ata Device driver. /platform/i86pc/kernel/drv/ata.conf Configuration file. /boot/solaris/bootenv.rc Boot environment variables file for Solaris x86. eeprom(1M) can be used to modify properties in this file. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |x86 | +-----------------------------+-----------------------------+ SEE ALSO
eeprom(1M), attributes(5) INCITS T13 ATA/ATAPI-7 specifications SunOS 5.10 9 Oct 2004 ata(7D)
All times are GMT -4. The time now is 07:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy