#!/bin/bash
#
#
if [ "${1}" = "pre" ]; then
# Do the thing you want before suspend here
echo "we are suspending." > /tmp/systemd_suspend_test.txt
elif [ "${1}" = "post" ]; then
# Do the thing you want after resume here
echo "and we are back from being suspended" >> /tmp/systemd_suspend_test.txt
#/usr/bin/gxmessage -fg red -font 'sans 30' -timeout 3 ' Computer has now resumed from suspend state.'
fi
I would like to extract the following fields from the text file attached. I copied the contents from a pdf file and pasted them into the text file so I can use awk to extract them. The layout is as listed below.
name1,name2,name3,name4,Title,designation,nationality,dob,
national ... (1 Reply)
Hi,
How can I debug an awk script?
I know that set -x can be used to debug a script. But this will not suite for awk scripts.
Can anyone help me?
Thanks in advance,
Chella (2 Replies)
Hi all,
i have two simple questions here...
1. i want to know that how to debug the UNIX shell script?
2. is there any way to handling the exception in UNIX shell script like oracle exception handling?
Please provide me those details it would be great help/
Thanks and Regards,
MPS... (3 Replies)
Hi All,
I have a script which is based on calculating current time
The script looks like this:
whenever i try to run the script it gives me error:Please advice wherther i have made mistake with if condition or with for loop??
The code :
set -x
#!/usr/bin/ksh
set -x... (7 Replies)
Hi,
When i run the script ./script.sh sun, this give me no output, it should give me the list of file.
If i run the script without the argument it should send me echo inside usage().
What is the problem?
please help
-Adsi
#!/bin/sh
ROOT_PATH=/net/icebox/vol/local_images/spins... (2 Replies)
Hi,
I have this script, searches and sets variables, then searches and sets more variables from multiple files.
I'd need to debug it a bit.
#!/bin/bash
egrep $1 `find | grep MAGT` >/tmp/resRA-$$
thread=`sed -n '/{0x/ {s/^.*{0x\(*\).*/\1/p;q}' /tmp/resRA-$$`
tag=`sed -n '/Tag=/... (5 Replies)
Hi I am relatively new in shell scripting Below is the code which i developed but for some reason, it keeps giving me error:
/apps/bss/BatchProg/at1/batch/scripts/ksh/TBATLC02.ksh: syntax error at line 41 : `then' unmatched
#!/usr/bin/ksh... (4 Replies)
Hello,
is it possible to debug a script that is already running "on-demand"?
Somehow a command like "set -x" but once you've executed the script. And another one to disable debugging?
Thank you (0 Replies)
Hi,
I am trying to get squid up and running using a redirector process, and every time I try to load a web page, squid fails miserably.
Can some one with perl and squid knowledge take a look at these codes and tell if something is wrong here.
#!/usr/bin/perl
#
$| = 1;
@endings = qw/... (0 Replies)
Discussion started by: jamie_123
0 Replies
LEARN ABOUT OPENSOLARIS
sys-suspend
sys-suspend(1) User Commands sys-suspend(1)NAME
sys-suspend - suspend or shutdown the system and power off
SYNOPSIS
/usr/bin/sys-suspend [-fnxh][-d displayname]
DESCRIPTION
sys-suspend provides options to suspend or shutdown the whole system.
A system can be suspended to conserve power or to prepare the system for transport. The suspend should not be used when performing any
hardware reconfiguration or replacement.
In case of suspend, the current system state is preserved either by keeping memory powered (Suspend to RAM), or by saving the state to non-
volatile storage (Suspend to Disk) until a resume operation is performed by power on or a wake-up event.
On a resume in the windows environment, the system brings up lockscreen to ensure that only the authorized person has access to the system.
In a non-windows environment, the user is prompted for password.
It is possible that when devices or processes are performing critical or time sensitive operations (such as real time operations) the sys-
tem fails to suspend. When this occurs, the system remains in its current running state. Messages reporting the failure are displayed on
the console or system log. Once the system is successfully suspended, the resume operation always succeed barring external influences such
as hardware reconfiguration or the like.
In case of shutdown, the system responds as if poweroff(1M) was performed.
This command enforces the solaris.system.power.suspend. authorizations. On a default install these are associated with the console user.
Other users need to include these authorizations or include the Suspend profile.
OPTIONS
The following operands are supported:
-d displayname Connect to the X server specified by displayname.
-f Force suspend. Causes a poweroff(1M) to occur if the suspend fails. System state are not be saved, and a normal boot follows.
-h Change the default from suspend to shutdown.
-n Do not display messages or request user intervention.
-x Disable lockscreen. This flag disables the execution of lockscreen at resume time.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWpmowu |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
SEE ALSO halt(1M), powerd(1M), poweroff(1M), shutdown(1M), attributes(5), cpr(7)SunOS 5.11 10 Mar 2009 sys-suspend(1)