I am trying to check two variables and if both are blank I want to set a flag:
the_f3_pid=`rsh $target ps -ef | grep "f3.eab" | awk '{print $2}'`
the_f7_pid=`rsh $target ps -ef | grep "f7.eab" | awk '{print $2}'`
if ; then
y=1
fi
I get an error:
./script_name: test: 0403-021 ]... (4 Replies)
hi,
i was trying to club to test condition with if.
if -o ; then
it is giving me error message, i wanted to ask how can we check two condtions with one if. (1 Reply)
Hi All,
I found a strange thing in one of our DB server.
one of the file system /orcale/ABC/rman size df output showing 100% full eventhough its occupying 2.18MB
$ df -mP /oraclev/ABC/rman
Filesystem MB blocks Used Available Capacity Mounted on
/dev/lv20906 1024.00 1024.00 0.00 100%... (2 Replies)
Hi,
Please clear the 2 questions,
2 Questions,
1) Why the new as a operator? Is there any special reason why it can't be a function like malloc?
2) How are we considering sizeof(),new are as a opearartors? I know + - * / -> , . etc.. are operators, which criteria satisfied by sizeof()... (4 Replies)
Hello,
I was written a cgi with a textarea to save some words from web.
I grab and write words like this:
$cgiparams{'CONTENTS'} =~ s/\r//g;
#$cgiparams{'CONTENTS'} =~ s/á/á/g;
open(TM, ">$editedfilename");
#binmode(TM,... (1 Reply)
All,
THe below is my script , when i use this i am getting nothing . could any one help me to know what is the use of the << operator below
su - $8 << supo
echo "exportsph $2 $1 $3 $4"
exportsph $2 $1 $3 $4
supo
i also tried as individual command su - userid << supo , when i do... (3 Replies)
Hi,
I have the below script executed
arg="dir"
if "$arg" = "dir"
then
echo "true"
else
echo "false"
fi
Please let me know what happens in the if command.
My output is:
dir: dir: No such file or directory
false
which is not the desired output.
When i used test command... (1 Reply)
im new to bash scripting and im just using online tutorials and trial and error. i wanted to write a script to read numbers from a file and find their sum:
#!/bin/bash
theSum=0
for line in $(cat numbers.txt)
do
let "theSum = theSum + $line"
echo "$line"
done
echo "The sum is... (3 Replies)
Hi,
In multi-level inheritance:
class A {
public:
void fun() { cout << "A" << endl; }
};
class B : public A {
public:
void fun() { cout << "A" << endl; }
};
class C : public B { };
int main() {
C c;
c.fun(); // Ans: A
} (1 Reply)
Discussion started by: royalibrahim
1 Replies
LEARN ABOUT SUNOS
strlcat
strcpy(9F) Kernel Functions for Drivers strcpy(9F)NAME
strcpy, strlcat, strlcpy, strncat, strncpy, strspn - String operations.
SYNOPSIS
#include <sys/ddi.h>
char *strcpy(char *dst, const char *src);
size_t strlcat(char *dst, const char *src, size_t dstsize);
size_t strlcpy(char *dst, const char *src, size_t dstsize);
char *strncat(char *restrict s1, const char *restrict s2, size_t n);
char *strncpy(char *dst, const char *src, size_t n);
size_t strspn(const char *s1, const char *s2);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
PARAMETERS
dst, src Pointers to character strings.
s1, s2 Pointers to character strings.
n Count of characters to be copied.
DESCRIPTION
The arguments dst, src, s1 and s2 point to strings. The strcpy(), strlcpy(), strncpy(), strlcat() and strncat() functions all alter their
first argument. These functions do not check for overflow of the array pointed to by the first argument.
strcpy()
The strcpy() function copies characters in the string src to dst, terminating at the first null character in src, and returns dst to the
caller. No bounds checking is done.
strncpy()
The strncpy() function copies src to dst, null-padding or truncating at n bytes, and returns dst. No bounds checking is done.
strlcpy()
The strlcpy() function copies a maximum of dstsize-1 characters (where dstsize represents the size of the string buffer dst) from src to
dst, truncating src if necessary. The result is always null-terminated. The function returns strlen(src). Buffer overflow can be checked
as follows:
if (strlcpy(dst, src, dstsize) >= dstsize)
return (-1);
strncat()
The strncat() function appends a maximum of n characters. The initial character of s2 overrides the null character at the end of s1.
strlcat()
The strlcat() function appends a maximum of (dstsize- strlen(dst)-1) characters of src to dst (where dstsize represents the size of the
string buffer dst). If the string pointed to by dst contains a null-terminated string that fits into dstsize bytes when strlcat() is
called, the string pointed to by dst is a null-terminated string that fits in dstsize bytes (including the terminating null character) when
it completes, and the initial character of src overrides the null character at the end of dst. If the string pointed to by dst is longer
than dstsize bytes when strlcat() is called, the string pointed to by dst is not changed. The function returns min{dst-
size,strlen(dst)}+strlen(src). Buffer overflow can be checked as follows:
if (strlcat(dst, src, dstsize) >= dstsize)
return -1;
strspn()
The strspn() function returns the length of the initial segment of string s1 that consists entirely of characters from string s2.
RETURN VALUES
strcpy(), strncat() and strncpy() return dst.
For strlcat(), strlcpy() and strspn(), see the Description section.
CONTEXT
These functions can be called from user or interrupt context.
SEE ALSO strlen(9F), strcmp(9F), bcopy(9F), ddi_copyin(9F)
Writing Device Drivers
SunOS 5.10 7 Sep 2004 strcpy(9F)