Hi all,
I'm new to Shell scripting. In my shell script for Bourne shell, the script accepts a date parameter which is optional. If the value is supplied, the supplied value should be assigned to a variable. If not, the current date will be assigned to the variable. My script is like this.
#!... (9 Replies)
Hi,
I have a file input which has 1000 data inputs of array elements.
I would like to pass this to a C program one line at a time as input automatically. Anyone know how I could use "sed" to perform this?
Appreciate alot. Thanks. (1 Reply)
Hi,
I am facing a problem to pass command line arguments that looks like
<script name> aa bb "cc" dd "ee"
I want to pass all 5 elements include the " (brackets). when I print the @ARGV the " disappear. I hope I explain myself
Regards,
Ziv (4 Replies)
Hi,
I have a very small requirement where i need to pass command output as an argument while invoking the shell script..
I need to call like this
sh testscript.sh ' ls -t Appl*and*abc* | head -n 1'
This will list one file name as ana argument..
I will be using "$1" in the shell... (2 Replies)
Hi Gurus,
I have written a script set_env.ksh to which I pass an argument and set the oracle login credentials based on the argument I pass.
The script has code as below.
ORACLE_SID=$1
DB_SCHEMA_LOGON=$DB_SCHEMA_USER/$DB_SCHEMA_PASSWORD@$ORACLE_SID; export DB_SCHEMA_LOGON;
echo... (3 Replies)
Hi,
I have a requirement to work on script, it should take either of arguments.
wrote it as below.
#!/bin/bash
usage() {
echo "$0: missing argument OR invalid option !
Usage : $0 -m|-r|-d
}
while getopts mrdvh opt; do
case "$opt" in
m) monitor_flag=monitor;;... (1 Reply)
Hi All,
I want to pass array of argument from Java to a shell script.I can use process builder api and its exec() method to call the script,but the question is how to receive the parameter in the script.
Thanks in advance
---------- Post updated at 10:00 PM ---------- Previous update was... (1 Reply)
hi,
I want to implement some function to perform following task
if ; then
$TEXT = "Data_0"
else
$TEXT = $1
fi
if ; then
$Lines = 45
else
$Lines = $2
fi
Kindly suggest,
thanks (11 Replies)
Hi all:
I'm trying to pass an argument to a command but it's being difficult.
#!/bin/bash
set -xv
if ; then
echo "More than 1 argument entered"
echo "Please enter a month using 3 character names, ie, Jan, Mar, Apr, Dec" && exit 1
fi
if ; then
echo "Please enter a month using... (2 Replies)
I have below script to read a file line by line. How can I ensure that the loop will stop after last line.
#!/bin/bash
while read -r mod ver tarball; do
echo $mod
done < taskfile.txt (4 Replies)
Discussion started by: aderamos12
4 Replies
LEARN ABOUT PHP
is_string
IS_STRING(3) 1 IS_STRING(3)is_string - Find whether the type of a variable is stringSYNOPSIS
bool is_string (mixed $var)
DESCRIPTION
Finds whether the type given variable is string.
PARAMETERS
o $var
- The variable being evaluated.
RETURN VALUES
Returns TRUE if $var is of type string, FALSE otherwise.
EXAMPLES
Example #1
is_string(3) example
<?php
$values = array(false, true, null, 'abc', '23', 23, '23.5', 23.5, '', ' ', '0', 0);
foreach ($values as $value) {
echo "is_string(";
var_export($value);
echo ") = ";
echo var_dump(is_string($value));
}
?>
The above example will output:
is_string(false) = bool(false)
is_string(true) = bool(false)
is_string(NULL) = bool(false)
is_string('abc') = bool(true)
is_string('23') = bool(true)
is_string(23) = bool(false)
is_string('23.5') = bool(true)
is_string(23.5) = bool(false)
is_string('') = bool(true)
is_string(' ') = bool(true)
is_string('0') = bool(true)
is_string(0) = bool(false)
SEE ALSO is_float(3), is_int(3), is_bool(3), is_object(3), is_array(3).
PHP Documentation Group IS_STRING(3)