I have a problem I don't understand... I am trying to declare a variable, and then output the results of that variable, couldn't be simpler
#!/bin/ksh
VAR='Oranges'
if
then
echo "Found Lemons"
elif
then
echo "Found Oranges"
fi
The output shouold clearly be "Found Oranges", but... (2 Replies)
Greetings To All!
I am running Solaris 10 in a sparc environment.
Here is the deal:
In /var/spool/cron/crontabs, there is a cron user named "sys". If I do a
crontab -l sys, it returns:
# 0 * * * 0-6 /usr/lib/sa/sa1
# 20,40 8-17 * * 1-5 /usr/lib/sa/sa1
# 5 18 * * 1-5 /usr/lib/sa/sa2... (8 Replies)
Hi, i have this code... in order to test my problem...
#include <stdio.h>
#include <iostream>
#include <pthread.h>
static void* cliente(void *datos);
int main()
{
pthread_attr_t tattr;
int ret;
size_t size = PTHREAD_STACK_MIN + 0x0100;
ret =... (8 Replies)
Hi All,
Appreciate if anyone can help. I've a script where it does echo function like this
while
do
FILE_ARG="cu0${w}_${FILE}_${DT}.av"
ORACLE_ERROR=`grep "ORA-" ${FILE_ARG}`
if ]; then
Func_Log_Writer "Fail! ${FILE_ARG}\n"
Func_Log_Writer "Error message:... (2 Replies)
Hi,
I've Ubuntu 8.04, and it has some files that I just cannot delete. I've tried everything, inode, fsck etc.
Here is what the ls -li outputs
root@ubuntu:/home/luser/.local/share/Trash/files/junk# ls -l
ls: cannot access TRUNK_: No such file or directory
ls: cannot access 2006_output.mv:... (11 Replies)
Hi,
I want to install net-snmp-devel package but i have following dependecy problem.
It's very odd, i don't get it. One of packages is depended on the other one, the other one is depended on the previous one as well. :S :S
Could you help me please?
Here are the steps:
# ls -l
total... (4 Replies)
My script-
result=""
times()
{
echo "inside the times function"
result=8
echo "Inside function $result"
return $result
}
result=$(times)
echo "the value is "$?
echo "the value of result $result"
when I run I get this, why the value still remain 0.
$ ./func
the value is 0
the value... (5 Replies)
I wonder if someone knows what is the rationale behind linking function calls of the POSIX threads library at link-time vs. run-time.
For example, if I create the following program:
#include <pthread.h>
void noop() {
return;
}
int main() {
pthread_self();
pthread_atfork(noop,... (1 Reply)
Hi,
I have a simple awk script:
BEGIN{}
{
$a=$2-$1;
print $a
}
END{if(NR==0){
print "0"
}
}
to which I provide the following input
2.9 14
22.2 27 (4 Replies)
Discussion started by: jamie_123
4 Replies
LEARN ABOUT NETBSD
__bit
BITS(3) BSD Library Functions Manual BITS(3)NAME
__BIT, __BITS, __SHIFTIN, __SHIFTOUT, __SHIFTOUT_MASK -- macros for preparing bitmasks and operating on bit fields
SYNOPSIS
#include <sys/param.h>
#include <sys/cdefs.h>
uintmax_t
__BIT(n);
uintmax_t
__BITS(m, n);
__SHIFTIN(v, mask);
__SHIFTOUT(v, mask);
__SHIFTOUT_MASK(mask);
DESCRIPTION
These macros prepare bitmasks, extract bitfields from words, and insert bitfields into words. A ``bitfield'' is a span of consecutive bits
defined by a bitmask, where 1s select the bits in the bitfield.
Use __BIT() and __BITS() to define bitmasks:
__BIT(n)
Return a bitmask with bit n set, where the least significant bit is bit 0.
__BITS(m, n)
Return a bitmask with bits m through n, inclusive, set. It does not matter whether m > n or m <= n. The least significant bit
is bit 0.
__SHIFTIN(), __SHIFTOUT(), and __SHIFTOUT_MASK() help read and write bitfields from words:
__SHIFTIN(v, mask)
Left-shift bits v into the bitfield defined by mask, and return them. No side-effects.
__SHIFTOUT(v, mask)
Extract and return the bitfield selected by mask from v, right-shifting the bits so that the rightmost selected bit is
at bit 0. No side-effects.
__SHIFTOUT_MASK(mask)
Right-shift the bits in mask so that the rightmost non-zero bit is at bit 0. This is useful for finding the greatest
unsigned value that a bitfield can hold. No side-effects. Note that __SHIFTOUT_MASK(m) = __SHIFTOUT(m, m).
EXAMPLES
The following example demonstrates basic usage of the bits macros:
uint32_t bits, mask, val;
bits = __BITS(2, 3); /* 00001100 */
mask = __BIT(2) | __BIT(3); /* 00001100 */
val = __SHIFTIN(0x03, mask); /* 00001100 */
val = __SHIFTOUT(0xf, mask); /* 00000011 */
SEE ALSO bitops(3), cdefs(3)HISTORY
The bits macros first appeared in atw(4), with different names and implementation. In their current form these macros appeared in
NetBSD 4.0.
AUTHORS
The bits macros were written by David Young <dyoung@NetBSD.org>.
Matt Thomas <matt@NetBSD.org> suggested important improvements to the implementation, and contributed the macro names SHIFTIN() and
SHIFTOUT().
BUGS
__BIT() and __BITS() can only express 32-bit bitmasks.
BSD October 17, 2012 BSD