Sponsored Content
Full Discussion: Debug script
Operating Systems Linux Ubuntu Debug script Post 303033285 by Don Cragun on Tuesday 2nd of April 2019 10:01:05 PM
Old 04-02-2019
Quote:
Originally Posted by drew77
I thought the temp files were automatically deleted upon reboots.?
Everything in /tmp is removed on reboot by default on some operating systems unless a local systems administrator decides to change that policy. I have no idea what Ubuntu does by default nor what the sysadmins who run your site have decided to implement.

It never hurts anything if you decide to clean up your temporary files when you're done with them! Smilie
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
File::Policy(3pm)					User Contributed Perl Documentation					 File::Policy(3pm)

NAME
File::Policy - Site policy for file I/O functions SYNOPSIS
use File::Policy; use File::Policy qw/check_safe/; # to import a specific subroutine use File::Policy qw/:all/; # to import all subroutines #Checking I/O policy check_safe($filename, 'r'); check_safe($filename, 'w'); #Preferred directory locations $logdir = get_log_dir(); $tmpdir = get_temp_dir(); DESCRIPTION
This defines the policy for file I/O with modules such as File::Slurp::WithinPolicy. The purpose is to allow systems administrators to define locations and restrictions for applications' file I/O and give app developers a policy to follow. Note that the module doesn't ENFORCE the policy - application developers can choose to ignore it (and systems administrators can choose not to install their applica- tions if they do!). You may control which policy gets applied by creating a File::Policy::Config module with an IMPLEMENTATION constant. You may write your own policy as a module within the File::Policy:: namespace. By default (if no File::Policy::Config is present), the File::Policy::Default policy gets applied which doesn't impose any restrictions and provides reasonable default locations for temporary and log files. The motivation behind this module was a standard, flexible approach to allow a site wide file policy to be defined. This will be most use- ful in large environments where a few sysadmins are responsible for code written by many other people. Simply ensuring that submitted code calls check_safe() ensures file access is sane, reducing the amount of effort required to do a security audit. If your code is not security audit'd, or you are the only developer at your site, this might be overkill. However you may consider it good practise regardless and protection against paths in your code getting corrupted accidently or maliciously in the future. There are two major benefits of using this module. One, sites that do implement a policy can more easily integrate your code in a standard way. If you have a file policy at your site, you can apply different policies (via File::Policy::Config) in different environments (pro- duction, integration test, development) and the appropriate policy is automatically applied without having to change your code or configs. FUNCTIONS
check_safe check_safe( FILENAME , MODE ); Checks FILENAME is safe - dies if not. MODE is r (read) or w (write). get_temp_dir $temporary_directory = get_temp_dir(); Returns the path to temporary directory. Note that any return value will have been cleared of a trailing slash. get_log_dir $log_directory = get_log_dir(); Returns the path to log directory. Note that any return value will have been cleared of a trailing slash. DEFINING YOUR OWN POLICY
To implement your own custom policy cp File/Policy/Default.pm File/Policy/YourPolicy.pm and modify YourPolicy accordingly. Then, create File/Policy/Config.pm contaning: use constant IMPLEMENTATION => 'YourPolicy'; Now having used File::Policy, calling check_safe in your scripts will enforce your policy (as well as give you access to log and temp paths in locations you recommend). SEE ALSO
File::Policy::Default, Safe VERSION
$Revision: 1.5 $ on $Date: 2005/05/18 15:58:21 $ by $Author: johna $ AUTHOR
John Alden <cpan _at_ bbc _dot_ co _dot_ uk> COPYRIGHT
(c) BBC 2005. This program is free software; you can redistribute it and/or modify it under the GNU GPL. See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt perl v5.8.8 2005-06-15 File::Policy(3pm)
All times are GMT -4. The time now is 07:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy