02-29-2016
You can't use that construct for indirection; it has a limited use only if a1 holds a numerical value. Recent bashs provide variable indirection:echo ${!a1}.
10 More Discussions You Might Find Interesting
1. Programming
I had seen this error for the first time .....
error: initializer expression list treated as compound expression
please help.... (12 Replies)
Discussion started by: arunchaudhary19
12 Replies
2. UNIX for Dummies Questions & Answers
hi there
i write one awk script file in shell programing
the code is related to dd/mm/yy to month, day year format
but i get an error
please can anybody help me out in this problem ??????
i give my code here including error
awk `
# date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies
3. AIX
--------------------------------------------------------------------------------
Hello, help me please.
I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? :
Command : failed stdout: yes stderr: no... (9 Replies)
Discussion started by: astjen
9 Replies
4. Shell Programming and Scripting
HI again, still working on the assignment, which is really hard given we just started unix 4 weeks ago. This script should change the permission for the user depending if its x, w or r, to the opposite. When i try to run it, I am getting expression error. Can you spot where the problem is? I really... (3 Replies)
Discussion started by: morava
3 Replies
5. Shell Programming and Scripting
Hi
what's the correct way of writing if
1)if "$time_diff" -gt 5
then
echo "killing hung process \n"
fi
2)if test $time_diff -gt 5
then
echo "killing hung process \n"
fi
where -time_diff=$(($Sam - $current_min))
and current_min=`date +%M`
infact both are giving Syntax... (1 Reply)
Discussion started by: Anteus
1 Replies
6. Shell Programming and Scripting
#! /bin/csh
set umr=UMR
foreach i ( `ls`)
set file_nm=$i
set bh_nm=`echo $file_nm | cut -d"_" -f2`
if($bh_nm !=$umr) then
{
set bh_ext=`echo $file_nm | cut -d"_" -f4`
set bh_num_nm="$bh_nm $bh_ext a .txt"
mv $file_nm $bh_num_nm
}
... (1 Reply)
Discussion started by: jdsignature88
1 Replies
7. Shell Programming and Scripting
I'm pretty new to shell scripting, but I am catching on quick. I did see one of the stickied threads about the csh, and I think this is relevant, but I don't understand enough to make a decision based on it. So as you'll see below, I use the |csh pipe, and if that is not correct, I'm certainly... (2 Replies)
Discussion started by: macman104
2 Replies
8. Shell Programming and Scripting
I've found this script which seems very promising to solve my issue:
To search and replace many different database passwords in many different (.php, .pl, .cgi, etc.) files across my filesystem.
The passwords may or may not be contained within quotes, single quotes, etc.
#!/bin/bash... (4 Replies)
Discussion started by: spacegoose
4 Replies
9. Shell Programming and Scripting
I'm using tcl scripts in ns2 ( network simulator) through cygwin. It works fine , however, I downloaded an example when i run it , I got the following syntax error:
syntax error in expression with " *2" : unexpected operator *
while executing :
"expr $bw *2"
invoked from within:
"$ns... (1 Reply)
Discussion started by: ENG_MOHD
1 Replies
10. Shell Programming and Scripting
Hello,
I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time.
My script:
returned=`tail -50 SapLogs.log | grep -i "Error"`
echo $returned
if ; then
echo "There is no errors in the logs"
fi
And after... (10 Replies)
Discussion started by: jedzio
10 Replies
LEARN ABOUT NETBSD
__builtin_types_compatible_p
__BUILTIN_TYPES_COMPATIBLE_P(3) BSD Library Functions Manual __BUILTIN_TYPES_COMPATIBLE_P(3)
NAME
__builtin_types_compatible_p -- GNU extension to check equivalent types
SYNOPSIS
int
__builtin_types_compatible_p(type_a, type_b);
DESCRIPTION
The __builtin_types_compatible_p() is a GNU extension for determining whether two types are equivalent. If type_a is equivalent to type_b, a
value 1 is returned. Otherwise __builtin_types_compatible_p() returns 0.
The following remarks should be taken into account.
1. The architecture-specific size of the two types does not have an impact on the result. For example, sizeof(char *) and
sizeof(int) result the same value on i386, but the types naturally are not equivalent.
2. Type qualifiers are ignored. The function returns the same value for long and const long.
3. The amount of pointer indirection affects the result. For example, double * is not equivalent to double **.
4. Two types defined with typedef are equivalent if and only if their underlying types are equivalent.
5. The enum type is a special case in that two enum types are not considered equivalent.
EXAMPLES
The following example combines __builtin_types_compatible_p() and the typeof(3) construct:
#define __COMPARE_TYPES(v, t)
__builtin_types_compatible_p(__typeof__(v), t)
...
if (__COMPARE_TYPES(p, double) != 0)
err(EX_DATAERR, "invalid type");
SEE ALSO
gcc(1), __builtin_constant_p(3), typeof(3)
CAVEATS
This is a non-standard, compiler-specific extension.
BSD
December 21, 2010 BSD