10-06-2003
I never noticed that we could do that. But I tried:
false
echo $?
and got a 1. Then I tried:
! false
echo $?
and I got a 0. Very interesting.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am writing a menu script and one of the options is to access a Command Prompt and return to the menu via CTRL-D. I have tried using a loop and echoing the PS1 value, then using read to assign whatever is entered into a variable, then executing the value of that variable as a command using
.... (1 Reply)
Discussion started by: sanitywonko
1 Replies
2. Shell Programming and Scripting
When I execute this line at the command prompt I get a different answer than when I run it in a script? Any ideas on how to resolve? I'm trying to find all files/dir in a directory except files that start with the word file.
Once I get this command to work, I will add the "delete" part to the... (6 Replies)
Discussion started by: blt123
6 Replies
3. UNIX for Advanced & Expert Users
I tried several times to get answer to the below problem. Someone can please help me?
$ cat p1.sh
#!/bin/sh
`./c1.sh &`
while # indefinite loop
do
x=5;
done
$ cat c1.sh # sleep for 10 sec and exit
#!/bin/sh
sleep 10;
Execute P1 as ./p1 &
$ ps -eaf | grep c1... (1 Reply)
Discussion started by: alexalex1
1 Replies
4. AIX
$cat /tmp/tuxob.lst
udi *****
jim 10
ant 19
ibm *****
$ input=`head -1 /tmp/tuxob.lst | awk '{print $NF}'`
$ echo $input
The output I am expecting is '*****'. But It is showing me the available files of current directory. When I run the command
head -1 /tmp/tuxob.lst | awk '{print $NF} ... (3 Replies)
Discussion started by: panchpan
3 Replies
5. Shell Programming and Scripting
How do I create a shell script called 'custinfo' to prompt a customer to enter and display back the following: name, age, address, phone number, product, price range.
Thanks (1 Reply)
Discussion started by: SQLScript
1 Replies
6. Shell Programming and Scripting
Hi All,
While running shell script i got following output.
interpreter "usr/bin/ksh" not found
sh: step1.sh: not found.
ldnhpux | oracle >echo $?
127
- Running command "which ksh" retruns "usr/bin/ksh".
- I found some information on web stating to remove extra carriage return chars,... (8 Replies)
Discussion started by: RuchirP
8 Replies
7. Shell Programming and Scripting
Hi all,
I need help figuring out why my script won't work when envoked from web interface. First off, I'm fairly new to Linux and Shell scripting so, my apologies for being ignorant!
So I have a python script that I envoke through a web interface. This script envokes my shell script and... (8 Replies)
Discussion started by: arod291
8 Replies
8. Shell Programming and Scripting
HSLIST=$1
LFILE=$2
STRING=$3
awk 'BEGIN {
while((getline < "'${HSLIST}'")>0)
S
FS="\n"; RS="}\n"
}
/servicestatus {/ && /service_description='${STRING}'/ {
for(X in D) delete D;
for(N=2; N<=NF; N++)
{
split($N, A, "="); (4 Replies)
Discussion started by: SkySmart
4 Replies
9. UNIX for Dummies Questions & Answers
Hi i have a script and i ma running that via nohup and &.
I am expecting that to return to the user prompt immediately.
But it's not returning and returns only after i press ctrl+c.
i am invoking the script as follow as :
nohup ./script args &
$ nohup: appending output to `nohup.out'
... (4 Replies)
Discussion started by: pandeesh
4 Replies
10. Solaris
Hi,
on sunfire v890 unable to move from rsc prompt to ok prompt, i have executed the command break. (9 Replies)
Discussion started by: manoj.solaris
9 Replies
IS_INT(3) 1 IS_INT(3)
is_int - Find whether the type of a variable is integer
SYNOPSIS
bool is_int (mixed $var)
DESCRIPTION
Finds whether the type of the given variable is integer.
Note
To test if a variable is a number or a numeric string (such as form input, which is always a string), you must use is_numeric(3).
PARAMETERS
o $var
- The variable being evaluated.
RETURN VALUES
Returns TRUE if $var is an integer, FALSE otherwise.
EXAMPLES
Example #1
is_int(3) example
<?php
$values = array(23, "23", 23.5, "23.5", null, true, false);
foreach ($values as $value) {
echo "is_int(";
var_export($value);
echo ") = ";
var_dump(is_int($value));
}
?>
The above example will output:
is_int(23) = bool(true)
is_int('23') = bool(false)
is_int(23.5) = bool(false)
is_int('23.5') = bool(false)
is_int(NULL) = bool(false)
is_int(true) = bool(false)
is_int(false) = bool(false)
SEE ALSO
is_bool(3), is_float(3), is_numeric(3), is_string(3), is_array(3), is_object(3).
PHP Documentation Group IS_INT(3)