Debug script


 
Thread Tools Search this Thread
Operating Systems Linux Ubuntu Debug script
# 22  
Old 04-05-2019
I added a line to play a sound file.

The error text file says

Code:
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).

Code:
#!/bin/bash 
#
# 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
fi

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. Shell Programming and Scripting

Problem with the script, help me debug

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

6. Shell Programming and Scripting

If condition error-please debug my script

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)
Discussion started by: usha rao
7 Replies

7. UNIX for Advanced & Expert Users

How can debug our UNIX shell script?

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)
Discussion started by: psiva_arul
3 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
Login or Register to Ask a Question
ubuntu-dev-tools(5)						File Formats Manual					       ubuntu-dev-tools(5)

NAME
ubuntu-dev-tools - Configuration for the ubuntu-dev-tools package. DESCRIPTION
The ubuntu-dev-tools package is similar in scope to the devscripts(1) package, providing a collection of scripts which may be of use to Ubuntu and Debian developers or others wishing to build Debian packages. Some of these scripts have options which may be configured on a system-wide and per-user basis. These options are configured in devscripts.conf(5). All variables are described in the script's manpages. Package-wide variables begin with "UBUNTUTOOLS" and are listed below. Every script which reads the configuration files can be forced to ignore them by using the --no-conf command-line option. ENVIRONMENT
All ubuntu-dev-tools configuration variables can be set (and overridden) by setting them in the environment (unlike devscripts). In addition, several scripts use the following environment variables: UBUMAIL Overrides DEBEMAIL and DEBFULLNAME when the target is clearly Ubuntu. Can either contain an e-mail address or Full Name <email@example.org>. DEBEMAIL, DEBFULLNAME As in devscripts(1). PACKAGE-WIDE VARIABLES The currently recognised package-wide variables are: UBUNTUTOOLS_BUILDER This specifies the preferred test-builder, one of pbuilder (default), sbuild, pbuilder-dist. UBUNTUTOOLS_DEBIAN_MIRROR The preferred Debian archive mirror. Should be of the form http://ftp.debian.org/debian (no trailing slash). If not specified, the master will be used. UBUNTUTOOLS_DEBSEC_MIRROR The preferred Debian security archive mirror. Should be of the form http://security.debian.org (no trailing slash). If not speci- fied, the master will be used. UBUNTUTOOLS_UBUNTU_MIRROR The preferred Ubuntu archive mirror. Should be of the form http://archive.ubuntu.com/ubuntu (no trailing slash). If not specified, the master will be used. UBUNTUTOOLS_UBUNTU_PORTS_MIRROR The preferred Ubuntu archive mirror. Should be of the form http://ports.ubuntu.com (no trailing slash). If not specified, the mas- ter will be used. UBUNTUTOOLS_LPINSTANCE The launchpad instance to communicate with. e.g. production (default) or staging. UBUNTUTOOLS_MIRROR_FALLBACK Whether or not to fall-back to the master archive mirror. This is usually the desired behaviour, as mirrors can lag the masters. If on a private network with only a local mirror, you may want to set this to no. One of yes (default) or no. UBUNTUTOOLS_UPDATE_BUILDER Whether or not to update the test-builder before each test build. One of yes or no (default). UBUNTUTOOLS_WORKDIR The directory to use for preparing source packages etc. When unset, defaults to a directory in /tmp/ named after the script. SEE ALSO
devscripts(1), devscripts.conf(5) AUTHORS
This manpage was written by Stefano Rivera <stefanor@ubuntu.com>. ubuntu-dev-tools December 19 2010 ubuntu-dev-tools(5)