Hello
I got a cycle in the script which open another scripts.
if
then
action
fi
Scripts action will be running 2 times at the same time.
Inside of action() is insert into the table.
But what I want is that only first script can do insert into table.
So how to do... (2 Replies)
Hello,
I have files in a dir.
I what to create a FOR cycle that will do this
FOR <condition> do
file=`ls <directory> | tail -1`
echo $file
mv -f $file <another dir>
done
What I want to now is what should I put in the <condition>. The condition I want is that the FOR will execute... (3 Replies)
hello everybody,
I need help on putting a wildcard match inside an if condition (I'm using korn shell):
if ]
then echo ' '
echo ''$MYSEL' is not a correct option'
echo ' '
else .....
i tried also #if -ne "``" and a lot of combinations of `"' but I didn't find the... (2 Replies)
i have a question how to modify below script to generate the expect result below :
test.sh
#!/bin/bash
for ((i=0; i < 25; i++))
do
echo $1$i
done
current result:
test.sh 20090101
200901010
200901011
200901012
200901013
200901014
200901015
200901016
200901017
200901018 (2 Replies)
Hi, i have a problem with a sed command runned in a for cycle...
I have a file named fileX which contains (i have crippled the line to minimal for easy):
load data dbfoo - TOCHANGE - comment
load data dbboo - TOCHANGE - comment
load data dbzoo - TOCHANGE - comment
...
And a file... (8 Replies)
Hi,
i would like to insert a if-then-else function in to cycle for
--------------
cat test
--------------
# cat test
ALFA
BETA
GAMMA
-----------------------
This is my script:
#!/bin/bash
for i in $(cat test); if ; then
echo "ok"
else (5 Replies)
Hello,
I am running a script under ubuntu 16.04
I have no problem with the script. My question is general algorithm of for file command.
I just need to know how for file in *.txt process works.
Let's say, I wish to run the script by sorting filename:
for file in *.txt
do
"do something in... (2 Replies)
Discussion started by: baris35
2 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)