04-03-2015
Is this part of a homework assignment?
What utility are you using to process this statement?
What diagnostic is it printing when you try to compile or run this code?
How are the variables $InputLine and $fields[] defined?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm getting an else unmatched error on the script below..
For info : SYDB is the database name entered as a param on the command line.
#Check the DB name
HBDB=`sql $SYDB <<_END_ | grep '^|' | grep -v dbase | sed 's/|//g' | sed 's/ //g'
set autocommit on;
\p\g
set lockmode... (7 Replies)
Discussion started by: b.hamilton
7 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I would like to create an IF statement where if a variable is equal to at least one of 2 (or more) values then the script proceeds. For example:
TEST_VAR=2
if ; then
echo success!
else
echo failure
fi
I understand that the above syntax is wrong but I feel it must be close. Any... (1 Reply)
Discussion started by: msb65
1 Replies
3. Shell Programming and Scripting
:b:Hi guys,
I am getting this error in this piece of code, Any help will be appreciate
rypidoc.shl: syntax error at line 79 : `for' unmatched
##Determine if there is a file to process
ls 3526*.dat > /dev/null 2>&1
if
then
exit
fi
for i in 3526*.dat
do
# Capture just the file... (2 Replies)
Discussion started by: rechever
2 Replies
4. Shell Programming and Scripting
#!/usr/bin/perl
$output1 = "/home/log.txt"
$output2 = "/home/grep.txt"
#Statement1 creates an output file called log.txt.
#Statement2 greps a line from log.txt and store the result in grep.txt
I want to create a condition where if the file grep.txt is empty repeat process.
Thanks. (1 Reply)
Discussion started by: sureshcisco
1 Replies
5. Shell Programming and Scripting
Hello forum members.
please go through the below mentioned issue and let me know the right solution.
I have to write a script which runs another script .the executable script take input parmeters.so iam writing the the script below .
Sample Code:Begins
#! /bin/ksh
echo " enter... (2 Replies)
Discussion started by: rajkumar_g
2 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I am trying to put multiple conditions in an IF Statement (using $$). the Linux script somehow doesnt like it. The logic I am trying to implement is as follows,
1. I will first search for DateFile.txt
2. If it exists & there is a P_BUS_DATE value in it, then assign the date value... (5 Replies)
Discussion started by: dsfreddie
5 Replies
7. Shell Programming and Scripting
Hi,
I am running sinple ksh script .
From some reason it failed on the following error:
./ogg_status.sh: syntax error at line 16 : `<<' unmatched
Please advise.
#!/usr/bin/ksh
export ORACLE_HOME=/software/oracle/DB10gR2
export LD_LIBRARY_PATH=/software/oracle/DB10gR2/lib:/usr/lib... (4 Replies)
Discussion started by: yoavbe
4 Replies
8. Shell Programming and Scripting
Hi,
I tried to go through a lot of online material but could not find concrete solution.
My issues is like this :
I've got a input file like this :
<a>
<startDate>19700101000000</startDate>
<endDate>20300101000000</endDate>
</a>
... (12 Replies)
Discussion started by: Shaishav Shah
12 Replies
9. Shell Programming and Scripting
Hi,
I need to put two condition in if statement, but it is not working. Please suggest.
if
---------- Post updated at 07:05 AM ---------- Previous update was at 06:55 AM ----------
Also when i put below command in script it is not running, but manually it is running
... (4 Replies)
Discussion started by: learnbash
4 Replies
10. Shell Programming and Scripting
Hi all,
I want to call a plsql package that does not return any value.
I am using the following script to do so:
sqlplus $UserNamePwd <<EOF
set head off
begin
test_pkg.procedure('$DebugFlag');
end;
exit
EOF
if
then
log_message "procedure failed."
exit 1
fi
exit $?
I... (2 Replies)
Discussion started by: reshma15193
2 Replies
BC(1) General Commands Manual BC(1)
NAME
bc - arbitrary-precision arithmetic language
SYNOPSIS
bc [ -c ] [ -l ] [ file ... ]
DESCRIPTION
Bc is an interactive processor for a language which resembles C but provides unlimited precision arithmetic. It takes input from any files
given, then reads the standard input. The -l argument stands for the name of an arbitrary precision math library. The syntax for bc pro-
grams is as follows; L means letter a-z, E means expression, S means statement.
Comments
are enclosed in /* and */.
Names
simple variables: L
array elements: L [ E ]
The words `ibase', `obase', and `scale'
Other operands
arbitrarily long numbers with optional sign and decimal point.
( E )
sqrt ( E )
length ( E ) number of significant decimal digits
scale ( E ) number of digits right of decimal point
L ( E , ... , E )
Operators
+ - * / % ^ (% is remainder; ^ is power)
++ -- (prefix and postfix; apply to names)
== <= >= != < >
= += -= *= /= %= ^=
Statements
E
{ S ; ... ; S }
if ( E ) S
while ( E ) S
for ( E ; E ; E ) S
null statement
break
quit
Function definitions
define L ( L ,..., L ) {
auto L, ... , L
S; ... S
return ( E )
}
Functions in -l math library
s(x) sine
c(x) cosine
e(x) exponential
l(x) log
a(x) arctangent
j(n,x) Bessel function
All function arguments are passed by value.
The value of a statement that is an expression is printed unless the main operator is an assignment. Either semicolons or newlines may
separate statements. Assignment to scale influences the number of digits to be retained on arithmetic operations in the manner of dc(1).
Assignments to ibase or obase set the input and output number radix respectively.
The same letter may be used as an array, a function, and a simple variable simultaneously. All variables are global to the program.
`Auto' variables are pushed down during function calls. When using arrays as function arguments or defining them as automatic variables
empty square brackets must follow the array name.
For example
scale = 20
define e(x){
auto a, b, c, i, s
a = 1
b = 1
s = 1
for(i=1; 1==1; i++){
a = a*x
b = b*i
c = a/b
if(c == 0) return(s)
s = s+c
}
}
defines a function to compute an approximate value of the exponential function and
for(i=1; i<=10; i++) e(i)
prints approximate values of the exponential function of the first ten integers.
Bc is actually a preprocessor for dc(1), which it invokes automatically, unless the -c (compile only) option is present. In this case the
dc input is sent to the standard output instead.
FILES
/usr/share/misc/lib.b mathematical library
dc(1) desk calculator proper
SEE ALSO
dc(1)
L. L. Cherry and R. Morris, BC - An arbitrary precision desk-calculator language
BUGS
No &&, ||, or ! operators.
For statement must have all three E's.
Quit is interpreted when read, not when executed.
7th Edition October 21, 1996 BC(1)