Sponsored Content
Top Forums Shell Programming and Scripting Desire structure for input file Post 302454668 by alister on Sunday 19th of September 2010 04:51:33 PM
Old 09-19-2010
Code:
sed 's/.*/A.& <> B.& or/; $s/ or$/;/'

Example:
Code:
$ cat data
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
$ sed 's/.*/A.& <> B.& or/; $s/ or$/;/' data
A.AAA <> B.AAA or
A.BBB <> B.BBB or
A.CCC <> B.CCC or
A.DDD <> B.DDD or
A.EEE <> B.EEE or
A.FFF <> B.FFF or
A.GGG <> B.GGG or
A.HHH <> B.HHH;

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying a Directory Structure to a new structure

Hi all Is it possible to copy a structure of a directory only. e.g. I have a file with the following entries that is a result of a find :- /dir1/dir2/file.dbf /dir1/dir2/dir3/file1.dbf /dir1/file.dbf I want to copy these to a directory and keep the structure however starting at a new dir... (8 Replies)
Discussion started by: jhansrod
8 Replies

2. Programming

Search attributes in one structure using the values from another structure

Hello Groups I am trying to find out ways of comparing a value from a 'c' structure to a value in another 'C' structure. the 'C' structure can be a List or liked list as it contains lot many records. if we loop it in both the structures it is going to consume time. I am looking for a simple... (3 Replies)
Discussion started by: dhanamurthy
3 Replies

3. Shell Programming and Scripting

How to create a directory structure with getting input from a file.

Hi How to create a directory structure with getting input from a file. I have file in that following lines are written. ./activemq-4.1.2/activemq-core-4.1.2.jar ./activemq-4.1.2/backport-util-concurrent-2.1.jar ./camel-1.4.0/apache-camel-1.4.0.jar ./camel-1.4.0/lib/activation-1.1.jar... (12 Replies)
Discussion started by: itsjoy2u
12 Replies

4. Shell Programming and Scripting

Can't get DF output I desire

I currently have a shell script that creates Oracle databases configured the way we want them here. One part of it allows you to choose which file system to place the database files. This is the command which works. This produces a list of file systems from which to choose. I have been... (1 Reply)
Discussion started by: sewood
1 Replies

5. Shell Programming and Scripting

Need script to take input from file, match on it in file 2 and input data

All, I am trying to figure out a script to run in windows that will allow me to match on First column in file1 to 8th Column in File2 then Insert file1 column2 to file2 column4 then create a new file. File1: 12345 Sam 12346 Bob 12347 Bill File2:... (1 Reply)
Discussion started by: darkoth
1 Replies

6. Shell Programming and Scripting

Copy files from input file with dir structure

hi, I want to copy files from source directory based on input file (or output of previous command) and i want to have the SAME DIRECTORY STRUCTURE. Note that i will have other files and directories which i dont want to copy to destination. For example, dir source has following content:... (22 Replies)
Discussion started by: dragon.1431
22 Replies

7. Hardware

HTC Desire S vs HTC Desire C - USB Android tethering problem

Hi gurus, I have problem with android usb tethering (usb0 interface). I tried two phones HTC Desire C and HTC Desire S. With Desire C everything works as expected, usb0 automatically goes up and gains IP address and tethering is working (output bellow) HTC Desire C: Nov 6 23:32:36 HP-PC... (0 Replies)
Discussion started by: wakatana
0 Replies

8. Shell Programming and Scripting

Case structure combined with standard input

Hi folks, I am new to bash scripting so please excuse my question. Is there any chance to combine a case structure with the read command? Like case (read -p "" variable) in x) Thx! (7 Replies)
Discussion started by: haukee
7 Replies

9. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

10. UNIX for Dummies Questions & Answers

How to get desire line?

Hi Guys, I am newbie here and greeting to all guys of unix forum, now I want to learn unix here. I have query here, we have file where file has 20 line record, now i want display 10 to 15 line row record only, then how it possible. (5 Replies)
Discussion started by: aaditya321
5 Replies
BESTUPS(8)							    NUT Manual								BESTUPS(8)

NAME
bestups - Driver for Best Power / SOLA (Phoenixtec protocol) UPS equipment NOTE
This man page only documents the hardware-specific features of the bestups driver. For information about the core driver, see nutupsdrv(8). SUPPORTED HARDWARE
bestups was designed to monitor Best Power UPS hardware like the Fortress, Fortress Telecom, Axxium Rackmount and Patriot Pro. It also recognizes and supports SOLA units such as the 325, 520 and 620. In addition, the Best 610 is supported using the 'ID' option. Other UPS hardware using the Phoenixtec protocol should also work, but they will generate a warning since their battery information is not known. This driver does not support some older Best/SOLA units. EXTRA ARGUMENTS
This driver supports the following optional settings in the ups.conf(5): nombattvolt=num Override the battery float voltage which is normally determined by asking the hardware. This is useful if your UPS constantly reports battery.charge values just below 100% even when it's completely charged. If you have this problem, set this to whatever battery.voltage reports when the UPS is known to be completely charged with a good battery. The author's Best Fortress 750 uses nombattvolt=27.4. battvoltmult=num Multiply the reported battery voltage by this number. Some devices report only a fraction of the total battery voltage. For example, the SOLA 610 700VA UPS (with a 24V battery) reports the single cell voltage (about 2.27V when fully charged). In this particular case you can set battvoltmult = 12 in ups.conf(8) to fix this. ID=string Set the Identification response string. This should only be used with hardware that supports the Phoenixtec protocol status inquiry commands, but not the "ID" command, such as the Best/SOLA 610. Format of the ID string is: AAA,BBBB,CCC,DDD,EE.E,FF.F AAA is the three-character identification for the UPS model. BBBB is the output power in VA (volt amperes). B is an integer number ranging from 0 to 9. CCC is the Nominal Input Voltage. C is an integer number ranging from 0 to 9. The unit is Volts AC. DDD is the Nominal Output Voltage. D is an integer number ranging from 0 to 9. The unit is Volts AC. EE.E is the Battery Voltage that will cause the UPS to shut itself off. E is an integer number ranging from 0 to 9. Then unit is Volts DC and a decimal point is present. FF.F or FFF.F is the Battery Voltage at full charge. F is an integer number ranging from 0 to 9. Then unit is Volts DC. Typically, for 700VA, 1KVA and 1.5KVA units, the format is FF.F. For 2KVA and 3KVA units, the format is FFF.F. Example: a Best 610 1.5KVA unit would use the string "610,1500,120,120,10.0,48.0". BUGS
The battery charge percentage value (in battery.charge) is derived from the voltage data that the UPS returns, since the UPS doesn't return that value directly. On some hardware, the charge will remain at 100% for a long time and then drops quickly shortly before the battery runs out. You can confirm from the battery.voltage readings that this is a problem with the UPS and not this driver. Similarly, the float from the charger in some models forces the battery charge percentage back up to 100% immedately after the UPS goes back on-line, so you can't tell when it is really recharged. Finally, some models give one value for the battery's nominal voltage and yet actually have a nominal voltage slightly below that. This leads to things such as the perpetual 98.7% charge on the author's Fortress 750, even when it's been charging for weeks. You can use nombattvolt= in ups.conf(8) to fix this. AUTHOR
Russell Kroll, Jason White SEE ALSO
The core driver: nutupsdrv(8) Internet resources: The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ Network UPS Tools 05/21/2012 BESTUPS(8)
All times are GMT -4. The time now is 08:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy