Debug script

Login or Register for Dates, Times and to Reply

Thread Tools Search this Thread
# 22  
I added a line to play a sound file.

The error text file says

VLC is not supposed to be run as root. Sorry.
If you need to use real-time priorities and/or privileged TCP ports
you can use /usr/bin/vlc-wrapper (make sure it is Set-UID root and
cannot be run by non-trusted users first).

# located in /lib/systemd/system-sleep/
# Created 4/2/19
exec 2> /tmp/systemd_suspend_test_err.txt

if [ "${1}" = "pre" ]; then
  # Do the thing you want before suspend here
  echo "we are suspending $(date +%I:%M:%S_%D)." 
elif [ "${1}" = "post" ]; then
  # Do the thing you want after resume here
   echo "and we are back from being suspended $(date +%I:%M:%S_%D)" 
  # gxmessage works IF xhost + is run first.
  gxmessage -timeout 5 -fg red -display :0 'Back from being suspended.'
  cvlc /usr/share/sounds/My_Sounds/Relax_6_Seconds.mp3

Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] How to debug awk script?

how can i view what variables are stored upon the excution of an awk script. something equivalent to shell eg. sh -vx "script_file" many thanks in advance! (1 Reply)
Discussion started by: Apollo
1 Replies

2. Shell Programming and Scripting

Debug perl script

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

3. Shell Programming and Scripting

Debug script already running

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)
Discussion started by: asanchez
0 Replies

4. Shell Programming and Scripting

Cant debug shell script

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)
Discussion started by: scripting_newbe
4 Replies

5. Shell Programming and Scripting

Help with debug the script

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)
Discussion started by: Vitoriung
5 Replies

6. Shell Programming and Scripting

Problem with the script, help me debug

Hi, When i run the script ./ 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)
Discussion started by: asirohi
2 Replies

7. Shell Programming and Scripting

anyone!! debug this small script..thanks in advance..

x="PermitRootLogin no" cd /etc/ssh y=`cat sshd_config |grep "PermitRootLogin"` if ] then print "Sorry, Remote Root SSH login already disabled." exit else print "Welcome to Remote SSH Login disable script." fi output: + x=PermitRootLogin no + cd /etc/ssh + + cat sshd_config... (2 Replies)
Discussion started by: solaix14
2 Replies

8. Shell Programming and Scripting

debug this script

echo "input time in hhmmss" read $st h=`echo $st | cut -c1-2` min=`echo $st | cut -c3-4` s=`echo $st | cut -c5-6` echo "input time in hhmmss" read $end h1=`echo $end | cut -c1-2` min1=`echo $end | cut -c3-4` s1=`echo $end | cut -c5-6` x= `expr $h /* 60 + $min` y= `expr $h1 /* 60 +... (8 Replies)
Discussion started by: abhishek27
8 Replies

9. Shell Programming and Scripting

How to debug the awk script

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)
Discussion started by: chella
2 Replies

10. Shell Programming and Scripting

Debug an Awk Script

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)
Discussion started by: mboro
1 Replies
Pod::Simple::Debug(3pm) 				User Contributed Perl Documentation				   Pod::Simple::Debug(3pm)

Pod::Simple::Debug -- put Pod::Simple into trace/debug mode SYNOPSIS
use Pod::Simple::Debug(5); # or some integer Or: my $debuglevel; use Pod::Simple::Debug ($debuglevel, 0); ...some stuff that uses Pod::Simple to do stuff, but which you don't want debug output from... $debug_level = 4; ...some stuff that uses Pod::Simple to do stuff, but which you DO want debug output from... $debug_level = 0; DESCRIPTION
This is an internal module for controlling the debug level (a.k.a. trace level) of Pod::Simple. This is of interest only to Pod::Simple developers. CAVEATS
Note that you should load this module before loading Pod::Simple (or any Pod::Simple-based class). If you try loading Pod::Simple::Debug after &Pod::Simple::DEBUG is already defined, Pod::Simple::Debug will throw a fatal error to the effect that "it's s too late to call Pod::Simple::Debug". Note that the "use Pod::Simple::Debug ($x, somenum)" mode will make Pod::Simple (et al) run rather slower, since &Pod::Simple::DEBUG won't be a constant sub anymore, and so Pod::Simple (et al) won't compile with constant-folding. GUTS
Doing this: use Pod::Simple::Debug(5); # or some integer is basically equivalent to: BEGIN { sub Pod::Simple::DEBUG () {5} } # or some integer use Pod::Simple (); And this: use Pod::Simple::Debug ($debug_level,0); # or some integer is basically equivalent to this: my $debug_level; BEGIN { $debug_level = 0 } BEGIN { sub Pod::Simple::DEBUG () { $debug_level } use Pod::Simple (); SEE ALSO
Pod::Simple The article "Constants in Perl", in The Perl Journal issue 21. See <> SUPPORT
Questions or discussion about POD and Pod::Simple should be sent to the mail list. Send an empty email to to subscribe. This module is managed in an open GitHub repository, <>. Feel free to fork and contribute, or to clone git:// <git://> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to <>. COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. AUTHOR
Pod::Simple was created by Sean M. Burke <>. But don't bother him, he's retired. Pod::Simple is maintained by: o Allison Randal "" o Hans Dieter Pearcey "" o David E. Wheeler "" perl v5.14.2 2012-05-23 Pod::Simple::Debug(3pm)

Featured Tech Videos