Sponsored Content
Top Forums Programming Need to modify contents of file with complex patterns. Post 302434800 by ygemici on Monday 5th of July 2010 07:26:58 AM
Old 07-05-2010
Code:
# sed 's: /var1: /var:;s: /flx1: /flx:'  infile
/dev/vg0/var1 /var ext3 defaults 0 2
/dev/vg0/flx1 /flx ext3 defaults 0 2
/dev/vg0/var /var ext3 defaults 0 1
/dev/vg0/flx /flx ext3 defaults 0 2

This User Gave Thanks to ygemici For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to modify the contents of file using script

Hi, Can anyone pls let me know how can i modify the file contents thru script. Eg. I have file abc.dat that contains below lines Merge.resync.cycleFlag Merge.resync.logFlag Merge.resync.maxByteRate Merge.resync.maxSearch Merge.resync.rate Merge.resync.tickLog ... (2 Replies)
Discussion started by: sdosanjh
2 Replies

2. Shell Programming and Scripting

Searching patterns in 1 file and deleting all lines with those patterns in 2nd file

Hi Gurus, I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
Discussion started by: toms
4 Replies

3. Shell Programming and Scripting

sed: How to modify files in a complex way

Hello, I am new to sed and hope that someone can help me with the following task. I need to modify a txt file which has format like this: xy=CreateDB|head.queue|head.source|head.definition|rtf.edit|rtf.task|rft.cut abc|source|divine|line4|5|true into something like: head.queue=abc... (19 Replies)
Discussion started by: pinkypunky
19 Replies

4. UNIX for Advanced & Expert Users

How do I modify file contents?

I have a table output in a text file (abc.txt)as follows col1 , col2 , col3 , col4 , Here I want to modify this file as follows col1 '~!#', col2 '~!#', col3 '~!#', col3 '^@\n' Could you help on this??? Thanks Kris (1 Reply)
Discussion started by: mkris
1 Replies

5. UNIX for Dummies Questions & Answers

How to modify lines without certain patterns?

I have file like this: rs111 A T 0.9 0.8 ... rs112 AT T 0.8 0.2 ... rs113 G CT 0.9 0.1... I wish to replace all the NONE "A" or "T" or "G" or "C" values in column 3 and column 4 to " ", how can I do this? thanks! (8 Replies)
Discussion started by: luoruicd
8 Replies

6. Shell Programming and Scripting

Grab contents between two matched patterns

I am wanting to fetch the content of the table within a file the table begins with data label like N Batch Mn(I) RMSdev I/rms Rmerge Number Nrej Cm%poss AnoCmp MaxRes CMlplc SmRmerge SmMaxRes $$ $$ . #columns of data . . . . . $$ I tried the command awk... (18 Replies)
Discussion started by: piynik
18 Replies

7. Shell Programming and Scripting

Folder contents getting appended as strings while redirecting file contents to a variable

Hi one of the output of the command is as below # sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/' Resource List : <br> *************************** 1. row ***************************<br> ... (2 Replies)
Discussion started by: vivek d r
2 Replies

8. Shell Programming and Scripting

Grab contents between two patterns

Hi, What is the best approach to grab contents between Changes Dependencies from the following example snippy Changes in packages about to be updated: bash-3.2-32.el5_9.1.x86_64 * Thu Jun 27 22:00:00 2013 Roman Rakus <rrakus@redhat.com> - 3.2-32.1 - Fixed a bug that caused... (2 Replies)
Discussion started by: ashokvpp
2 Replies

9. Shell Programming and Scripting

Bash - Find files excluding file patterns and subfolder patterns

Hello. For a given folder, I want to select any files find $PATH1 -f \( -name "*" but omit any files like pattern name ! -iname "*.jpg" ! -iname "*.xsession*" ..... \) and also omit any subfolder like pattern name -type d \( -name "/etc/gconf/gconf.*" -o -name "*cache*" -o -name "*Cache*" -o... (2 Replies)
Discussion started by: jcdole
2 Replies
partclone.extfs(8)					      System Manager's Manual						partclone.extfs(8)

NAME
partclone.extfs - The utility for clone and restore an etx2/ext3 partition. SYNOPSIS
partclone.extfs [options]... [MODE] [SOURCE FILE] [OUTPUT FILE] DESCRIPTION
partclone.extfs is a part of Partclone project for ext2/3 file system. Partclone is a project like the well-known backup utility "Parti- tion Image" a.k.a partimage. Partclone provide utilities to back up used blocks and design for higher compatibility of the file system using supported library like e2fslibs. OPTIONS
-o, --output FILE Output FILE -O --overwrite FILE Output FILE, overwriting if exists -s, --source FILE Source FILE -L, --logfile FILE Log FILE -c, --clone Save to the special image format -r, --restore Restore from the special image format -b, --dev-to-dev Local device to device copy mode -D, --domain Create GNU Ddrescue domain log file from source device --offset_domain=X Add X (in bytes) to all positions reported in the domain log file -R, --rescue Continue after disk read errors -dX, --debug=X Set the debug level to X = [0|1|2] -C, --no_check Don't check device size and free space -X, --dialog Output message as Dialog Format -I, --ignore_fschk Ignore filesystem check --ignore_crc Ignore crc check error -F, --force Force progress -f, --UI-fresh Fresh times of progress -q, --quiet quiet mode, no progress update -v, --version Display partclone version -h, --help Display this help Examples: clone /dev/hda1 to hda1.img and display debug information. partclone.extfs -c -d -s /dev/hda1 -o hda1.img restore /dev/hda1 from hda1.img and display debug information. partclone.extfs -r -d -s hda1.img -o /dev/hda1 restore image from clonezilla(split, gzip,) with stdin source cat sda1.ext3-ptcl-img.gz.a* > gunzip -c | partclone.ext3 -d -r -s - -o /dev/sda1 REPORTING BUGS
Report bugs to <thomas@nchc.org.tw> SUPPORT
You can get support at http://partclone.org AUTHOR
This manual page was written by Thomas Tsai <thomas@nchc.org.tw> partclone 0.2.48 Nov 2007 partclone.extfs(8)
All times are GMT -4. The time now is 06:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy