06-15-2014
sed reads an entire file!
This is 1. not efficient if you want to only change one line,
and 2. it reads the entire file.txt at the first cycle, so the file is ended at the next cycles.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
ok, this one is definitely too hard for my shell-script-skills.
Hopefully, there is somebody who can help me with this:
I have a folder with files in it named
0.ppm
10.ppm
2.ppm
...
5.ppm
50.ppm
55.ppm
...
355.ppm
360.ppm
etc.
As you will notice, the order in which the files are... (5 Replies)
Discussion started by: silversurfer202
5 Replies
2. AIX
Good evening ...
does anyone of you know how to change major/minor numbers of disk devices ?
I had to migrate from raid1 to raid5 and this messed up my ASM cluster - I know which devices should have which IDs to match the content - but I have no idea how to change it.
Any help would be... (2 Replies)
Discussion started by: zxmaus
2 Replies
3. Shell Programming and Scripting
Howdy experts,
We have some ranges of number which belongs to particual group as below.
GroupNo StartRange EndRange
Group0125 935300 935399
Group2006 935400 935476
937430 937459
Group0324 935477 935549
... (6 Replies)
Discussion started by: thepurple
6 Replies
4. Shell Programming and Scripting
Hello All,
I am having problem to find what is the smallest number from 90% of highest numbers from all numbers in file. I am having file with thousands of lines and hundreds of columns.
I am familiar mainly with bash but I am open to whatever suggestion witch will lead to the solutions.
If I... (11 Replies)
Discussion started by: Apfik
11 Replies
5. Shell Programming and Scripting
Hello,
Here's a file of mine:
key1:431
key2:159
key3:998
I need to change these keys to something bigger - and I actually need to shift them all by a range of 3.
The output would be:
key1:434
key2:162
key3:1001
I can't find the propper sed/awk line that would alter all my... (4 Replies)
Discussion started by: fzd
4 Replies
6. Shell Programming and Scripting
Hi All,
I was using some commands to:
replace a column by a constant string character awk -v a=CA 'NF>1{ $3=a; print; } ' $line>$line"_1"
to copy a column and paste it in another place awk '$5=$2" "$5' $line>$line"_2"
to delete the extra columns awk '{for(i=1;i<=NF;i++)... (9 Replies)
Discussion started by: CAch
9 Replies
7. Shell Programming and Scripting
Hi, I have some datatexts with values and I want to replace only the values of the first file with the result of array loaded in one variable.
Also I want the operation difference with the original value replaced and only replace the new value not the character format of the file.
Some Idea?... (24 Replies)
Discussion started by: faka
24 Replies
8. Shell Programming and Scripting
I have a bunch of file numbers in the file 'test':
I'm trying the above command to change all the instances of "H" to "Na+" in the file testsds.pdb at the line numbers indicated in the file 'test'. I've tried the following and various similar alternatives but nothing is working:
cat test |... (3 Replies)
Discussion started by: crunchgargoyle
3 Replies
9. Shell Programming and Scripting
Hi friends,
i need a command which can be used to change the values in file.
I have file which contain some values.
Data_Center_costing=XXXX
Financial_loss=XXXX
operational_cost=XXX
I am not aware about the values of XXXX, They may be 4 digit or less/more than that. but i need these... (12 Replies)
Discussion started by: Nakul_sh
12 Replies
10. UNIX for Beginners Questions & Answers
Hi!
I found and then adapt the code for my pipeline...
awk -F"," -vOFS="," '{printf "%0.2f %0.f\n",$2,$4}' xxx > yyy
I add -F"," -vOFS="," (for input and output as csv file) and I change the columns and the number of decimal...
It works but I have also some problems... here my columns
... (7 Replies)
Discussion started by: echo manolis
7 Replies
LEARN ABOUT SUNOS
pm_trans_check
pm_trans_check(9F) Kernel Functions for Drivers pm_trans_check(9F)
NAME
pm_trans_check - Device power cycle advisory check
SYNOPSIS
#include <sys/sunddi.h>
int pm_trans_check(struct pm_trans_data *datap, time_t *intervalp);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI)
PARAMETERS
datap Pointer to a pm_trans_data structure
intervalp Pointer to time difference when next power cycle will be advised
DESCRIPTION
The pm_trans_check(9F) function checks if a power-cycle is currently advised based on data in the pm_trans_data structure. This function
is provided to prevent damage to devices from excess power cycles; drivers for devices that are sensitive to the number of power cycles
should call pm_trans_check(9F) from their power(9E) function before powering-off a device. If pm_trans_check(9F) indicates that the device
should not be power cycled, the driver should not attempt to power cycle the device and should fail the call to power(9E) entry point.
If pm_trans_check(9F) returns that it is not advised to power cycle the device, it attempts to calculate when the next power cycle is
advised, based on the supplied parameters. In such case, intervalp returns the time difference (in seconds) from the current time to when
the next power cycle is advised. If the time for the next power cycle cannot be determined, intervalp indicates 0.
To avoid excessive calls to the power(9E) entry point during a period when power cycling is not advised, the driver should mark the corre-
sponding device component busy for the intervalp time period (if interval is not 0). Conveniently, the driver can utilize the fact that
calls to pm_busy_component(9F) are stacked. If power cycling is not advised, the driver can call pm_busy_component(9F)
and issue a timeout(9F) for the intervalp time. The timeout() handler can issue the corresponding pm_idle_component(9F) call.
When the format field of pm_trans_data is set to DC_SCSI_FORMAT, the caller must provide valid data in svc_date[], lifemax, and ncycles.
Currently, flag must be set to 0.
struct pm_scsi_cycles {
int lifemax; /* lifetime max power cycles */
int ncycles; /* number of cycles so far */
char svc_date[DC_SCSI_MFR_LEN]; /* service date YYYYWW */
int flag; /* reserved for future */
};
struct pm_trans_data {
int format; /* data format */
union {
struct pm_scsi_cycles scsi_cycles;
} un;
};
RETURN VALUES
"small and bold">Power cycle is advised
0 Power cycle is not advised
-1 Error due to invalid argument.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO
power.conf(4), attributes(5), power(9E)
Writing Device Drivers
Using Power Management
SunOS 5.10 16 Oct 1999 pm_trans_check(9F)