not found error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting not found error
# 1  
Old 05-11-2007
Java not found error

Hi I have to move data to a file based on the valuies of first three characters in a file I am using the following script

FIN=$LOC/TEST.TXT
FEEDFILE=$LOC/TUE_GROSSJE.TXT

#Read the file

while read FDROW
do

FEEDROW=$FDROW;


DTYPE=`echo $FEEDROW |cut -c 1-3`

if [$DTYPE=351] ; then
$FEEDROW >> $FIN
fi

done < $FEEDFILE

However whenever I am executing the script I am getting the error as [351=351]: not found
the data with 351 as first three characters is present in the file
Please help
# 2  
Old 05-11-2007
Code:
if [ $DTYPE -eq 351 ] ; then

= is for string comparison. Leave a space after and before the square brackets
# 3  
Old 05-11-2007
Just need some spaces and the correct operator ('=' is a tstring comparison operator). Instead of

if [$DTYPE=351]

You should have:

if [ $DTYPE -eq 351 ]

If you wish to compare them as strings you should use quotes (still need the spaces).

if [ "$DTYPE" = "351" ]

Try 'man test' for more information.
# 4  
Old 05-11-2007
Thanks Its seems to have solved the problem but the errror of not found I am now getting is for line

$FEEDROW >> $FIN

Is there any syntax error in the above statement
# 5  
Old 05-11-2007
try echo $FEEDROW >> $FIN
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command not found error 'then'

Could you let me know if my path is having bourne bash echo $PATH /u01/app/oracle/product/10.2.0/db_1/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/oracle/bin $ which bash /bin/bash $ which ls alias ls='ls --color=tty' /bin/ls Below is... (3 Replies)
Discussion started by: csguna6
3 Replies

2. Shell Programming and Scripting

/bin/sh: : not found error

Hello, When i run the shell script in Solaris, i am getting the below error. /bin/sh: Test.sh: not found I have tried including "#!/bin/bash" , did not work, tried with #!/bin/ksh , did not work, tried without the above include in the script, but still did not work. Please help me to... (5 Replies)
Discussion started by: balareddy
5 Replies

3. UNIX for Dummies Questions & Answers

Variable not found error

Hi, I get a "FILEPATH: not found" error on the 3rd line and the line where it is within the case. Any idea as to why I'm getting this error time and time again? Oh and FILEPATH will store the directory of the file. I appreciate any help! IAM=`basename $0` RC=0 FILEPATH = ""... (1 Reply)
Discussion started by: MIA651
1 Replies

4. Linux

command not found error

I installed in VM the Mandriva Linux. But when I fire the make command it gives me command not found error. Seems make is not installed. I also checked in Mandriva control center and no development package is seen there. Will pls let me know how to proceed and get make and other development... (2 Replies)
Discussion started by: rupeshkp728
2 Replies

5. Shell Programming and Scripting

sh: gzip: not found ERROR

I am creating a script to run the SysInfo tool under HPUX servers, this is my script! #!/usr/bin/ksh # # Date: February 29th 2011 # #Definicion de variables PATH_TMP=/home/eponcede > HPUX_SysInfo.log for host in `cat $PATH_TMP/servers/host_hp2_test` do echo... (2 Replies)
Discussion started by: eponcedeleonc
2 Replies

6. Shell Programming and Scripting

Command not found error!

Hello everyone, I am using Linux and tcsh shell. I am trying to run a free open source program( which is in the form of a binary file), but every time I run it it gives me an error saying: newhtsg_v1.0:Command not found. I have set permission also for the same. What else can I do to make... (4 Replies)
Discussion started by: ad23
4 Replies

7. Red Hat

Command Not Found Error?

Hi, I am beginer to Linux. I have installed Redhat Linux AS 4.0 on my System.Later I created a User Oracle10g for Installing Oracle.Then I logged onto Oracle10g user and crated a Bash Profile and when I run that profile there was an error in that Profile. from then If I type any of Linux Command... (2 Replies)
Discussion started by: praswer
2 Replies

8. UNIX for Dummies Questions & Answers

sqlload not found error

When i try to run a job in unix, i am getting sqlload error as, sqlload : file not found. Can any one please let me know whats the reason for this.. The PATH & ORACLE_HOME paths names are correct... thanks:confused: hr is the script: here is the script : plz hv a look TABLE_NAME=... (2 Replies)
Discussion started by: abhi_123
2 Replies

9. Programming

library not found error

We are trying to execute C/C++ programs in SOlaris 8. Though the exes are compiled in g++, we donot have it installed in the target machine. We have the library files in the target machine and LD_LIBRARY_PATH is set correctly. Now when the exes are run, we are getting the error $ seq ld.so.1:... (1 Reply)
Discussion started by: virtual_j
1 Replies

10. Shell Programming and Scripting

ERROR -> ./txt1[2]: x: not found

Hi all, When I try to run this shell script (name txt1) script -> txt1 ------------------------ #!/usr/bin/ksh x = "hello" echo "$x" ------------------------ error while executing ------------------------ serv1> txt1 ./txt1: x: not found ------------------------ (2 Replies)
Discussion started by: k_oops9
2 Replies
Login or Register to Ask a Question