04-28-2009
thanks for the explanation cfajohnson
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
What is the script that takes a port number as parameter and displays status, whether it is available or is already used by other process
pls help (1 Reply)
Discussion started by: saikiran
1 Replies
2. UNIX for Dummies Questions & Answers
How to find the last argument in a argument line? (4 Replies)
Discussion started by: nehagupta2008
4 Replies
3. UNIX for Dummies Questions & Answers
I have a script named abc.sh and another script ab.sh
I execute one as:
./abc.sh
and another ./ab start
that is with an argument , so wanted to know what is this start a file or something else? (4 Replies)
Discussion started by: nixhead
4 Replies
4. Shell Programming and Scripting
If ($argv == “-debug”) then
Echo “in loop”
Endif
But this is not working. If I modify this code and remove “-“, then it works.
Similarly I am getting problem using grep command also
Grep “-debug” Filename
Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies
5. UNIX for Dummies Questions & Answers
Hey everyone,
I need to write a script that will display the number of the argument before displaying the argument itself. Here's what I have so far:
for arg in "$@"
do
echo $#:$arg
done
This returns the sum of all arguments preceding the arguments themselves.
$(script) a b c
3:a... (1 Reply)
Discussion started by: unclepickle1
1 Replies
6. Shell Programming and Scripting
Hello,
Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file
i.e I am workiing on a script which will run through crontab and the script will
chekout the code ,zip and copy to the... (3 Replies)
Discussion started by: rohit22hamirpur
3 Replies
7. Shell Programming and Scripting
Hi I am new in shell,
I am trying to create a small script that can do exit if a script is executed when argument not 2
#!/bin/sh
if ; then
echo greater
exit 1;
elif ; then
echo less
exit 1;
fiit keeps returning me
whatever number of argument I... (1 Reply)
Discussion started by: peuceul
1 Replies
8. UNIX for Advanced & Expert Users
Hi All,
I am running the script
VBoxManage list vms |sed 's/"//g' | cut -d " " -f1 > har1out.mytxt
result=`cat har1out.mytxt | grep $1'
echo $result
echo $1
{
if
then
echo pass
else
echo fail
fi (2 Replies)
Discussion started by: harsha85
2 Replies
9. Shell Programming and Scripting
Hello
Does the unix korn shell provide a function to convert number entered in command line argument to text or Character so that in next step i will convert Chr to Hex (6 Replies)
Discussion started by: aadityapatel198
6 Replies
10. Shell Programming and Scripting
Hi Experts,
I have been trying to work on a simple shell script that will just add the two argument passed to it. Here is what i tried :
#!/bin/bash
welcome(){
echo "Welcome to this Progg. which will accept two parameter"
}
main_logic(){
arg=$#
echo "Number of argument passed is... (4 Replies)
Discussion started by: mukulverma2408
4 Replies
LEARN ABOUT DEBIAN
explain_setsid_or_die
explain_setsid_or_die(3) Library Functions Manual explain_setsid_or_die(3)
NAME
explain_setsid_or_die - sets process group ID and report errors
SYNOPSIS
#include <libexplain/setsid.h>
pid_t explain_setsid_or_die(void);
pid_t explain_setsid_on_error(void);
DESCRIPTION
The explain_setsid_or_die function is used to call the setsid(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_setsid(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_setsid_on_error function is used to call the setsid(2) system call. On failure an explanation will be printed to stderr,
obtained from the explain_setsid(3) function, but still returns to the caller.
RETURN VALUE
The explain_setsid_or_die function only returns on success, see setsid(2) for more information. On failure, prints an explanation and
exits, it does not return.
The explain_setsid_on_error function always returns the value return by the wrapped setsid(2) system call.
EXAMPLE
The explain_setsid_or_die function is intended to be used in a fashion similar to the following example:
explain_setsid_or_die();
SEE ALSO
setsid(2)
creates a session and sets the process group ID
explain_setsid(3)
explain setsid(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2011 Peter Miller
explain_setsid_or_die(3)