could somebody tell me please how to exit a shell script:
if
then
echo "No arguments detected"
exit 1
fi
...
echo "still there" # is displayed .. :-( (4 Replies)
Hi All,
I am unable to exit from a shell script using the below code:
#!/bin/ksh
passchk()
(
if ;then
echo "Password validated"
else
echo "Wrong password Quiting the application..."
exit 0#not working
fi
)
passchk
(Note:"finalresult" passed to the passchk... (2 Replies)
Hi All,
I tried looking for this, but was not able to get a clear answer. Hence posting here. Please find the details below. Thanks for the help
I have 2 shell scripts, script1.sh and script2.sh. I call script2.sh from within script1.sh ( by simple ./script2.sh command).
Based on some... (7 Replies)
I need help in the following script. I want to grep the sql errors insert into the error table and exit the shell script if there is any error, otherwise keep running the scripts.
Here is my script
#!/bin/csh -f
source .orapass
set user = $USER
set pass = $PASS
cd /opt/data/scripts
echo... (2 Replies)
hi guys
I have a script that I need to terminate or exit the shell or session completely for the user but the exit only exit from the script and takes the user to the shell
I found this
https://www.unix.com/unix-dummies-questions-answers/399-using-exit-command-shell-script.html
saying that... (1 Reply)
hi,
i want to pop up an alert box using perl script. my requirement is.
i am using a html page which calls a perl script. this perl script calls a shell script.. after the shell script ends its execution, i am using exit 0 to terminate the shell script successfully and exit 1 to terminate the... (3 Replies)
Hi,
suppose my script is sample.sh
i have to run using '. ./sample.sh'
as . ./script file always executes the script in my parent shell.
when my sample.sh contains exit command .. my environment is getting closed as am executing in the parent shell ...
please suggest me how can i use... (5 Replies)
Hi all,
I have a situation to read exit value of a command (not exit code) and process further.
bash-4.2$ returnvalue=`ssh DOMAIN\\\\user1@10.7.7.68 'cmd /c "del C:\Users\user1\db_test.bak"'`
Could Not Find C:\Users\user1\db_test.bak
bash-4.2$ echo $?
0
bash-4.2$ echo $returnvalue... (3 Replies)
Discussion started by: baluchen
3 Replies
LEARN ABOUT DEBIAN
file::counterfile
CounterFile(3pm) User Contributed Perl Documentation CounterFile(3pm)NAME
File::CounterFile - Persistent counter class
SYNOPSIS
use File::CounterFile;
$c = File::CounterFile->new("COUNTER", "aa00");
$id = $c->inc;
open(F, ">F$id");
DESCRIPTION
This module implements a persistent counter class. Each counter is represented by a separate file in the file system. File locking is
applied, so multiple processes can attempt to access a counter simultaneously without risk of counter destruction.
You give the file name as the first parameter to the object constructor ("new"). The file is created if it does not exist.
If the file name does not start with "/" or ".", then it is interpreted as a file relative to $File::CounterFile::DEFAULT_DIR. The default
value for this variable is initialized from the environment variable "TMPDIR", or /usr/tmp if no environment variable is defined. You may
want to assign a different value to this variable before creating counters.
If you pass a second parameter to the constructor, it sets the initial value for a new counter. This parameter only takes effect when the
file is created (i.e. it does not exist before the call).
When you call the "inc()" method, you increment the counter value by one. When you call "dec()", the counter value is decremented. In both
cases the new value is returned. The "dec()" method only works for numerical counters (digits only).
You can peek at the value of the counter (without incrementing it) by using the "value()" method.
The counter can be locked and unlocked with the "lock()" and "unlock()" methods. Incrementing and value retrieval are faster when the
counter is locked, because we do not have to update the counter file all the time. You can query whether the counter is locked with the
"locked()" method.
There is also an operator overloading interface to the File::CounterFile object. This means that you can use the "++" operator for
incrementing and the "--" operator for decrementing the counter, and you can interpolate counters directly into strings.
COPYRIGHT
Copyright (c) 1995-1998,2002,2003 Gisle Aas. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Gisle Aas <gisle@aas.no>
perl v5.10.0 2004-01-23 CounterFile(3pm)