LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-03-2010, 11:57 AM   #1
boyd98
Member
 
Registered: Oct 2003
Posts: 156

Rep: Reputation: 15
KSH - Script error; invalid command -


HP-UX 11.31
/sbin/sh

Essentially my ksh script calls a program and passes some commands. It's entering the program just fine, but when it passes the commands it gets "invalid command" error, and loops for a bit.

====
#!/usr/bin/ksh
$cer_exe/cmbview -dom ivv <<!
kill -all
exit
!
====

When I run all the steps manually the program works fine. I turned debug on and see that it enters the program, cmbview, but for whatever reason, it fails on any command that it tries to parse.

root:ivv@ispux06:/cerner/replicate_backup/ispux06/ivv> ksh -x test.ksh
+ /cerner/w_standard/ivv_wh/hpuxia64/cmbview -dom ivv
+ 0< /tmp/sh1972.1
Message Bus (CMB) Monitor
invalid command
invalid command
invalid command
invalid command

I'm really struggling here. Can't figure this one out. Tried running it in a ksh shell, same error. Tried running it as bash shell, same error.

The cmbview exe works and the following commands work, so I can only assume its something with the script parsing the commands.


Any help is greatly appeciated -

Boyd
 
Old 08-03-2010, 12:02 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by boyd98 View Post
HP-UX 11.31
/sbin/sh

Essentially my ksh script calls a program and passes some commands. It's entering the program just fine, but when it passes the commands it gets "invalid command" error, and loops for a bit.

====
#!/usr/bin/ksh
$cer_exe/cmbview -dom ivv <<!
kill -all
exit
!
====

When I run all the steps manually the program works fine. I turned debug on and see that it enters the program, cmbview, but for whatever reason, it fails on any command that it tries to parse.

root:ivv@ispux06:/cerner/replicate_backup/ispux06/ivv> ksh -x test.ksh
+ /cerner/w_standard/ivv_wh/hpuxia64/cmbview -dom ivv
+ 0< /tmp/sh1972.1
Message Bus (CMB) Monitor
invalid command
invalid command
invalid command
invalid command

I'm really struggling here. Can't figure this one out. Tried running it in a ksh shell, same error. Tried running it as bash shell, same error.

The cmbview exe works and the following commands work, so I can only assume its something with the script parsing the commands.


Any help is greatly appeciated -

Boyd
Which are the commands you are entering one by one ? Please post them here one command per line.
 
Old 08-15-2010, 08:16 AM   #3
boyd98
Member
 
Registered: Oct 2003
Posts: 156

Original Poster
Rep: Reputation: 15
Thx for the response - It was actually an issue with the program - which surprised me greatly.
 
Old 07-19-2012, 11:00 AM   #4
manolin
LQ Newbie
 
Registered: Jan 2012
Posts: 6

Rep: Reputation: Disabled
ns: [code omited because of length] : invalid command name "Agent/Vanet"

hi
i wrote a new agent and modified the relevant files (makefile,packet.h,ns-default.tcl ) ,then i make clean and make the ns-2.34 i get this error (no rule to make target 'vanet.o' needed by ns) and when i want to run my tcl file i get this error (ns: [code omited because of length] : invalid command name "Agent/Vanet" while executing "Agent/Vanet set packetSize_ 64").

will u pls help me out with this error.
i appreciate any help.
 
Old 07-19-2012, 11:22 AM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,609

Rep: Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105
> i get this error (no rule to make target 'vanet.o' needed by ns)

First, you should find out where vanet.o should came from. It would be a good idea to ask the person who wrote this Makefile.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why am getting error ksh: syntax error: `fi' unexpected while running script deb4you Linux - Newbie 4 09-06-2008 09:37 AM
Porting ksh script from Solaris to Linux Gives unmatched if error markatharvestinfotec Programming 4 08-28-2008 02:51 PM
mod_perl error Invalid command 'PerlOptions' agentc0re Slackware 6 05-24-2007 02:22 PM
cryptsetup error (Command failed: Invalid argument) SlackN00b Slackware 5 02-07-2007 01:59 PM
Apache error - Invalid Command 'AddType'... humbletech99 Linux - Networking 0 11-28-2005 09:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration