Sponsored Content
Full Discussion: sed usage
Top Forums Shell Programming and Scripting sed usage Post 302304035 by audiophile on Saturday 4th of April 2009 02:13:39 PM
Old 04-04-2009
PHP sed usage

I'd like to extract the temps from the following command via a series of sed statements but the actual syntax is beyond me.

Code:
$ nc localhost 7634 
|/dev/sg1|ST3640323AS|31|C||/dev/sg2|ST3640323AS|30|C||/dev/sg3|ST3750330AS|32|C||/dev/sda|ST3640323AS|31|C||/dev/sdb|ST3640323AS|30|C||/dev/sdc|ST3750330AS|32|C|

So for /dev/sda I just want to get the number "31" and likewise for sdb "30" and sdc "32"
 

10 More Discussions You Might Find Interesting

1. Linux

sed usage

Hi , I have a question. How do I replace 2 words in one line like this IN CLO07 INDEX IN CLOIX07 to IN CLO07_S02 INDEX IN CLOIX07_S02 But one thing to remember is that there are lots of words like CLODM001 . So the only matching pattern is "IN CLO" sample file... (4 Replies)
Discussion started by: capri_drm
4 Replies

2. Shell Programming and Scripting

possible sed usage

Sorry about the title. I'm assuming I want sed anyway... Here's the deal: I have hundreds of files in a folder and they all are named with the same format. $NAME-$VERSION-$ARCH-$BUILD This is Slackwares' /var/log/packages directory BTW... $BUILD is what I'm focusing on. It could be... (6 Replies)
Discussion started by: madpenguin
6 Replies

3. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

4. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

5. Shell Programming and Scripting

Sed usage

How can i use sed to change "Linux Cpu (EDF).sh" to "LinuxCpuEDF.sh"? I want to replace the spaces and brackets. (4 Replies)
Discussion started by: proactiveaditya
4 Replies

6. Shell Programming and Scripting

sed usage

Hi, I want to read a command value and replace the command value in another file. Anybody know how to write it??? For example: File A: Command1 = test File B: Command1 = Command2 = Command3 = I want to write a shell script to read content from File A and replace Command1... (3 Replies)
Discussion started by: linboco
3 Replies

7. Shell Programming and Scripting

sed usage

Hi, I want to replace some character whenever there is a space using sed. Input file name: aaa command i am trying is sed 's/^$/A/g' aaa (2 Replies)
Discussion started by: rakeshbharadwaj
2 Replies

8. Shell Programming and Scripting

'sed' usage error.

Friends, I came across a wierd scenario while using sed. When I use the below cmd sequence at OS prompt it works fine: sed 's/# TMOUT=120/TMOUT=900/g' /etc/profile > /etc/profile.011211 However when I use the same in a script it throws the following error: ==Error== sed: 0602-404... (4 Replies)
Discussion started by: thisissouvik
4 Replies

9. Shell Programming and Scripting

sed usage with Variable

Gurus, I am trying to display a match (single character) from beginning of the line in a file using a variable. I tried using sed ... not sure where am doing it wrong... sed -n "/^\$variable/p" FileName.shor sed -n "/^\${variable}/p" FileName.shBoth of the above are not working.....Thanks... (4 Replies)
Discussion started by: Kevin Tivoli
4 Replies

10. Shell Programming and Scripting

sed command usage

Hi, Can anyone let me know the sed command usage requirement: sed 's/standard/standard_and/' <new.txt>new.txt here it needs to search for the pattern "standard" in the file new.txt and it should replace as "standard_and" in the same file new.txt Note: new.txt is having a separator... (8 Replies)
Discussion started by: srikanth_sagi
8 Replies
bup-margin(1)						      General Commands Manual						     bup-margin(1)

NAME
bup-margin - figure out your deduplication safety margin SYNOPSIS
bup margin [options...] DESCRIPTION
bup margin iterates through all objects in your bup repository, calculating the largest number of prefix bits shared between any two entries. This number, n, identifies the longest subset of SHA-1 you could use and still encounter a collision between your object ids. For example, one system that was tested had a collection of 11 million objects (70 GB), and bup margin returned 45. That means a 46-bit hash would be sufficient to avoid all collisions among that set of objects; each object in that repository could be uniquely identified by its first 46 bits. The number of bits needed seems to increase by about 1 or 2 for every doubling of the number of objects. Since SHA-1 hashes have 160 bits, that leaves 115 bits of margin. Of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. If you're paranoid about the possibility of SHA-1 collisions, you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. OPTIONS
--predict Guess the offset into each index file where a particular object will appear, and report the maximum deviation of the correct answer from the guess. This is potentially useful for tuning an interpolation search algorithm. --ignore-midx don't use .midx files, use only .idx files. This is only really useful when used with --predict. EXAMPLE
$ bup margin Reading indexes: 100.00% (1612581/1612581), done. 40 40 matching prefix bits 1.94 bits per doubling 120 bits (61.86 doublings) remaining 4.19338e+18 times larger is possible Everyone on earth could have 625878182 data sets like yours, all in one repository, and we would expect 1 object collision. $ bup margin --predict PackIdxList: using 1 index. Reading indexes: 100.00% (1612581/1612581), done. 915 of 1612581 (0.057%) SEE ALSO
bup-midx(1), bup-save(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-margin(1)
All times are GMT -4. The time now is 05:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy