It works fine when used in if loop, but how to print the returned value.
The S_ISDIR macro returns an integer. If the file is a directory the S_ISDIR macro returns non-zero and to print that value use it as an expression inside a printf statement.
Hallo
I want write a sh script but I have some troubles!
How can I write the Return value to a variable? I need an egrep command with the option -c, how many times it give the pattern. This return value shold be written in a variable.
Could you help me? (1 Reply)
hi
iam reading data from web page using request socket and curl socket.
now my problem is some the web page containg data as a image so how can i read the data from a image.
thank,inadvance.
sree (3 Replies)
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Hi guys,
I am newbie in unix, so I need your help.
I need to right unix function code that can read sample.txt. If sample.txt contains sentence such as "Error due to syntax." then it will return value.
I tried below code, but I got errors.
if
then
echo " There are... (4 Replies)
ls xx > yy.log
echo $? can get the return value of "ls xx"
but if I use
ls xx |tee -a yy.log
I can't get the return value of "ls xx", and I get the return value of the whole cmd "ls xx |tee -a yy.log", it is always "0"
my question is how could I get the return value of "ls xx"... (1 Reply)
I am using the popular bash shell.
Under the current interactive shell, i run the script like:
". ./myscript.txt" . After the current shell has finish the script, the shell will continue to work as I did previously. Actually I want the shell can return from the middle of the scripts it is... (1 Reply)
Not sure where the problem is. I can run the script without any issue using the following command.
. /opt/app/scripts/cdc_migration.sh
But it fails with the below error when I try it this way
/opt/app/scripts/cdc_migration.sh
/opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies
LEARN ABOUT HPUX
portal
portal(5) File Formats Manual portal(5)NAME
portal - a "window to the future" for applications
SYNOPSIS DESCRIPTION
This header file is a "window to the future" for applications. It will help you to:
o Write code that is portable across 32-bit and 64-bit systems,
o Avoid undocumented assumptions about sizes of integral types,
o Write portable code that needs to be explicit about the sizes of integral types,
o Write code that is portable to a platform which has different sizes of integral types, and
o Share frequently used macros that are portable across 32-bit and 64-bit systems.
In addition to the macros defined in this file, it includes the header files (see limits(5)) and (see inttypes(5)).
The following macros are defined in
This macro can be used to create a mask that has one bit set.
bit_num is the position of the bit to set, and type is the data type of the mask. A -1 is returned in the case of overflow or
underflow.
This macro can be used to set a bit in a mask.
mask is the current value of the mask, bit_num is the position of the bit to set, and type is the data type of the mask.
This macro can be used to return the bit position
of the sign bit for the specified data type. type is the data type for which to return the position of the sign bit.
This macro can be used to return a mask for the sign bit for
the specified data type. type is the data type for which to return the sign bit mask.
This macro can be used to do a sign extension from one
data type to another. value is the current value that is to be sign-extended. old_type is the current data type of value and
new_type is the new data type of value.
This macro can be used to check if code has been
compiled big or little endian. endian is an integer in which the result will be returned.
The following macros can be used for print formatting and scan formatting of values of data types that can change in size based upon the
compilation flag Examples of such data types are off_t and fpos_t.
EXAMPLES
The macro in the following example will turn on the high bit in a 64-bit integer.
The macro in the following example will be used to turn on all bits except the sign bit in a 32-bit integer.
The macro in the following example will turn on the three least significant bits of the maximum integer.
The macro in the following example will return the position of the sign bit in a 32-bit integer.
The macro in the following example will return a sign bit mask for a 32-bit integer.
The macro in the following example will convert the 8-bit integer stored in a char data type to a 64-bit integer and correctly extend the
sign.
The macro in the following example will store a 1 in endian if the compilation was big endian; otherwise, it will store a 0 in endian.
AUTHOR
was developed by HP.
FILES SEE ALSO inttypes(5), limits(5), printf(3S), scanf(3S).
portal(5)