02-26-2013
I don't think so. "s" is a String object and not a Boolean. You would get a compilation error if you were to try the latter option.
if ( ! s.empty() ) ==> Checks if the string object does not have any string held in the buffer which it points to.
if ( s ) ==> Checks if s is null or not.
Last edited by balajesuri; 02-26-2013 at 02:19 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
I have written shell script whcih at the max 3 parameters.
When only one commandline argument and other two command line arguments are passed as empty string like
eg : archive ' ' ' '
Then i need to check whether the commandline... (12 Replies)
Discussion started by: rahman_riyaz
12 Replies
2. Shell Programming and Scripting
How to check if a string in contained in another string ?
Like
Whether the String "brown" is contained in
"A quick brown fox jumps over a lazy the dog" (1 Reply)
Discussion started by: hidnana
1 Replies
3. Shell Programming and Scripting
Hi all,
I have one CSV file(MasterFile.csv) consists of two columns.
"./incoming/ABC.CSV","./incoming/ABC_CONTROL.txt"
"./incoming/PQR.CSV","./incoming/PQR_CONTROL.txt"
"./incoming/123.CSV","./incoming/123_CONTROL.txt"
I have written a script to read the MasterFile.csv.Here i want to... (4 Replies)
Discussion started by: sollins
4 Replies
4. Shell Programming and Scripting
Hi one to All
i have written the code for searching the string in the file for specified path. its working fine,
but my req:if the string is not available in the file , it should display the Message saying that , string is not available in the file.
code is:
echo "give the path where... (12 Replies)
Discussion started by: saic
12 Replies
5. UNIX for Dummies Questions & Answers
i have a veriable
set var1
set var2 = abcd
how can i check if var 1 is empty and if var 2 is not empty ??? (2 Replies)
Discussion started by: nirnir26
2 Replies
6. Web Development
Hi,
I am sharing this tip with you all.The codes given below will explain
/**
* Checking a folder is empty or not.
* @param string $folderName
* $folderName should be folder name or path
* @return TRUE/FALSE (If any file or folder found/Empty folder)
*/
function... (1 Reply)
Discussion started by: elizas
1 Replies
7. Shell Programming and Scripting
Hi! I need to learn that how a shell script can transverse a csv file n check if any field is empty or not. means its contains two comma or space b/w commas i.e., "" or " ".
can anyone help me out how I can do that.... (10 Replies)
Discussion started by: sukhdip
10 Replies
8. Shell Programming and Scripting
Hi ,
I have a file likeA-0044150|ABC/Frito/
A-0044150|GFHU
A-0150075|Bud Racing
A-0187811|Bud Light
A-0187811|RW&B signmaking
I Want the o/p likeA-0044150|ABC/Frito/,GFHU
A-0150075|Bud Racing
A-0187811|Bud Light,RW&B signmaking (2 Replies)
Discussion started by: jagdishrout
2 Replies
9. Shell Programming and Scripting
I am reading from a file and executing the jobs with/without parameters as the job requires.
File
job1 R
job2
job3 Y 123
if
then
<job>.ksh
else
<job>.ksh $params
fi
This works fine if the line read from the file has parameters
it executes like job1.ksh R
But for... (2 Replies)
Discussion started by: nw2unx123
2 Replies
10. Shell Programming and Scripting
Hello
So i have that script collection, in which i have a single script to create a configuration file.
In there, i have multiple occourences of something like this:
prj_title=$(tui-read "What is the TITLE? ($prj_name):")
] && prj_title="${prj_name/_/ }"
They all work as expected, if... (5 Replies)
Discussion started by: sea
5 Replies
LEARN ABOUT HPUX
privset_del
privileges(3) Library Functions Manual privileges(3)
NAME
privileges: priv_addset(), priv_delset(), priv_ismember(), priv_isobserved(), privset_add(), privset_alloc(), privset_copy(),
privset_del(), privset_empty(), privset_fill(), privset_free(), privset_intersect(), privset_inverse(), privset_isempty(), privset_ise-
qual(), privset_isfull(), privset_ismember(), privset_issubset(), privset_subtract(), privset_union() - privilege manipulation operations
for checking and debugging purposes
SYNOPSIS
Parameters
dstp to type; points to the destination privilege set.
num type; specifies a privilege by number.
privid type; contains the ID of the privilege to be acted upon.
privname type; string that contains the name of the privilege to be acted upon.
privp Pointer to type; points to the privilege set to be acted upon.
srcp to type; points to the source privilege set.
DESCRIPTION
Adds the privilege privname to the privilege set referred to by privp.
Removes the privilege
privname from the privilege set referred to by privp.
Check whether the named privilege
privname is a member of the privilege set privp.
Checks whether the calling process observes the named privilege
privname See privileges.5 for more information on when a process observes a privilege.
Adds the privilege
privid to the privilege set referred to by dstp.
Allocates memory for a privilege set of type
but does not initialize the space. The space allocated by this routine should be released using the routine.
Copies the privilege set referred to by
srcp to the privilege set referred to by dstp.
Removes the privilege specified by
num from the privilege set referred to by privp.
Clears all privileges from
privp.
Assigns all privileges, including those not currently define on the system, to
the privilege set privp.
Deallocates the space used by the privilege set referred to by
privp. If privp is NULL, no action occurs.
Finds the privileges that the privilege sets
srcp and dstp have in common and places the results in the privilege set dstp.
Inverts the privilege set pointed to by
privp.
Checks whether the privilege set
privp is the empty set.
Checks whether the privilege sets
srcp and dstp are equal sets.
Check whether the privilege set
privp is the full set of privileges. A full set of privileges is a set with all bits set, regardless of whether the privi-
lege is currently defined on the system.
Check whether the privilege
privid is a member of the privilege set privp.
Checks whether the privilege set
srcp is a subset of the privilege set dstp.
Subtracts the privilege set referred to by
srcp from the privilege set referred to by dstp.
Checks the privileges in the privilege sets
srcp and dstp and puts any privilege that is in either set into dstp.
RETURN VALUE
and return the following values:
Successful completion.
Function failed.
is set to indicate the error.
and return the following values:
Non-zero number.
Condition is TRUE.
Condition is FALSE.
is set to indicate the error.
returns the following values:
pointer Successful completions. Returns a non-null pointer to the allocated space.
NULL pointer
Function failed. Returns a null pointer and sets to indicate the error .
ERRORS
If any of the following conditions occur, the functions fail and set
Insufficient memory available to allocate space to hold a privilege set.
The application can try again later.
Invalid argument.
SEE ALSO
priv_getbyname(3), priv_getbynum(3), priv_set_to_str(3), priv_str_to_set(3), privileges(5).
privileges(3)