ksh93 if statement gives "not found" error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ksh93 if statement gives "not found" error
# 1  
Old 03-07-2011
ksh93 if statement gives "not found" error

Why do I get the error on the second example?.

This works:
Code:
if [[ "a" = "a" ]];then
> echo "true"
> else
> echo "false"
> fi
true

This doesn't, and gets the error shown:
Code:
if [[ "a" = "a" ]];then
> b=1
> else
> b=0
> fi
-ksh93: line 2: .
b=1: not found.

# 2  
Old 03-07-2011
You sure you didn't make a mistake and use backspace while typing b=1

Perhaps you typed b- then backspace then =1 (I get the above error if I do that) but fine if I type without making a correction.

Code:
if [[ "a" == "a" ]];then
> b-^H=1
> else
> b=0
> fi
ksh93: line 2: .
b=1: not found.

This User Gave Thanks to Chubler_XL For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script fails with "function: not found" error

Hello everyone, I am having problems figuring this out. This script below is supposed to create a list of file names with their "md5sum", in a file "lib-list.txt" When I run it "sh component-list.sh " I get this:component-list.sh: 4: component-list.sh: function: not found component-list.sh:... (4 Replies)
Discussion started by: joemb
4 Replies

2. Shell Programming and Scripting

Cant get awk 1liner to remove duplicate lines from Delimited file, get "event not found" error..help

Hi, I am on a Solaris8 machine If someone can help me with adjusting this awk 1 liner (turning it into a real awkscript) to get by this "event not found error" ...or Present Perl solution code that works for Perl5.8 in the csh shell ...that would be great. ****************** ... (3 Replies)
Discussion started by: andy b
3 Replies

3. Shell Programming and Scripting

Source command returns error when it strikes conditional statement "ifeq"

Hello All, I am running source command on my project configuration file app.cfg which has conditional statements with make file systax E.g ifeq ($(APP_CMP_DIR),trunk). When I source this file it throws error: syntax error near unexpected token... (1 Reply)
Discussion started by: anand.shah
1 Replies

4. Shell Programming and Scripting

If statement failing with error "pc.sh[21]: [yscc02 =yscc02]: not found."

Dear all I wrote a shell script which runs perfect in OEL linux 5.2 but its failing in AIX 5.3 this scripts check if db is up then it wont proceed else proceed with rest steps. any help is appreciated. -------------------------------------------- ORACLE_BASE=/u01/app/oracle... (2 Replies)
Discussion started by: javeedkaleem
2 Replies

5. Red Hat

Could interrupt disabled cause "opreport error: No sample file found"?

Hi All I would like to profile my application with oprofile but I can't since no samples are collected. The kernel of my app is 2.6 on RED HAT Enterprise 5.3 (Tikanga) so OProfile is setup in timer interrupt mode # opcontrol --list-events Using timer interrupt. I... (0 Replies)
Discussion started by: manustone
0 Replies

6. Shell Programming and Scripting

sendmail script throwing an error "No recipient addresses found in header"

Hi, I am using following code to send an e-mail with attachment and body. echo "To: user1@mail.com,user2@mail.com" > mail.tmp echo "Cc: user3@mail.com,user4@mail.com" >> mail.tmp echo "From: group@mail.com" >> mail.tmp echo "Subject: my report" >> mail.tmp echo "please see as attached"... (6 Replies)
Discussion started by: vivek_damodaran
6 Replies

7. Red Hat

"No Drives Found" error during Redhat Linux AS 4 installation

I'm trying to install Redhat LInux AS 4 update 4 on an IBM x306 series server. I keep getting following error: "No Drives Found. An error has occurred - no valid devices were found on which to create new file systems. Please check your hardware for the cause of this problem." I called IBM and... (2 Replies)
Discussion started by: pieman8080
2 Replies

8. UNIX for Dummies Questions & Answers

why emacs caused "command not found" error

I installed Red Hat Enterprise Linux 5 on my PC. When i typed 'emacs' on the console, "command not found" error occurrd. Why. :mad: (1 Reply)
Discussion started by: cy163
1 Replies

9. Solaris

Network Path Not Found Error "Sunfire V100"

I recently got this new old server from a friend. I just installed a fresh version of Solaris 10 on it. I have put a static IP of 192.168.100.10 the server. Their is no subnetting scheme on the network. And I made the hostname "SunServ." And I also changed the folder "/etc/inet/hosts" because I... (4 Replies)
Discussion started by: louisd11
4 Replies
Login or Register to Ask a Question