Calling commands with ksh

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Calling commands with ksh
# 1  
Old 06-06-2011
Calling commands with ksh


I am not able to run below command on linux, it however works on solaris. If anyone knows the reason and a solution for it can you please let me know ?

$> ksh 'echo hi'
ksh: echo hi: No such file or directory
$> which ksh

$> ksh 'echo hi'


Last edited by pludi; 06-06-2011 at 02:52 PM..
# 2  
Old 06-06-2011
Originally Posted by krishnaux

I am not able to run below command on linux, it however works on solaris. If anyone knows the reason and a solution for it can you please let me know ?
Most shells expect to be given filenames when run in that fashion. The -c option tells it to run the following as literal script content. Try ksh -c 'echo hi'. Hopefully that should work fine on both.
# 3  
Old 06-07-2011

Thanks very much !! this is what i was looking for and it works Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Calling subscript with sh vs. ksh

I ran into an issue today that I was able to resolve, but I don't quite understand why the resolution worked. I'm wondering if anyone can help me make sense of it. I have a "kicker" script that calls 4 subscripts on a RHEL 6.9 server. It calls the scripts in sequence checking for a 0 exit code... (5 Replies)
Discussion started by: derndingle
5 Replies

2. Shell Programming and Scripting

calling perl commands in shell

i have four commands 1. perl -MCPAN -e shell 2. o conf prerequisites_policy follow 3. o conf commit 4. exit I am attempting to streamline a bunch of yum commands and cpan installations and want to remove the confirmation portion of the cpan these four commands will do just that. my... (2 Replies)
Discussion started by: murphybr
2 Replies

3. UNIX for Advanced & Expert Users

Oracle (11gr2) calling unix commands (aix)

I have an Oracle database running on AIX, and I have a procedure that is calling OS commands from an oracle (and it's not working anymore)... so, there was an Java stored proc in Oracle CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED COMMON."Host" as import*; public class Host {... (1 Reply)
Discussion started by: bongo
1 Replies

4. Shell Programming and Scripting

Calling Function in KSH

I have a script with 2 functions 1) show_menu 2) create Ths show_menu function works fine....... Sort of.... When I select option 2 of the menu the code does a few commands and then calls another function called create. It's at this point that I get "create: not found"..... However,... (2 Replies)
Discussion started by: hxman
2 Replies

5. Shell Programming and Scripting

calling jar file from ksh

Hi, I have a below command in ksh .... $JAVA_HOME/bin/java -cp "/usr/orabase/product/10.2.0/lib:/usr/java/javajar/common/sched.jar:/usr/orabase/product/10.2.0/jdbc/lib/ojdbc14_g.jar:/usr/orabase/product/10.2.0/jdbc/lib/classes12.jar" I want to know where the... (1 Reply)
Discussion started by: PRKS
1 Replies

6. Shell Programming and Scripting

calling two procedures from one ksh ???

Hi to all, This is first posting in this forum. I quite new to this KSH....i guess i ll have some fun...:) Well, I have two indivdual korn shell scripts. i m calling PL/SQL stored procedure from korn shell script. It works absolutely fine. Once its completed the log is updated and data is... (5 Replies)
Discussion started by: shashi369
5 Replies

7. Programming

calling UNIX commands C/C++

hi Guys, I am planning to write a program which can be able to execute scripts/commands which needs a user to be root. Note: we are not interested to use sudoers option. .e.g. The requirement can be explaind as: A normal UNIX system user cannot execute above command(veritas cluster... (3 Replies)
Discussion started by: Asteroid
3 Replies

8. Shell Programming and Scripting

Calling GDB commands from Shell

Hi, I have just started off with the shell programming. I need to execute a GDB command from a shell script. I have been trying to get this working from quite sometime but not getting it quite right.I have this specific requirement that i read byte data from a file and write that data to the... (0 Replies)
Discussion started by: jsantosh
0 Replies

9. Shell Programming and Scripting

calling a PL/SQL stored procedure from KSH

Hi I have a stored procedure which should be called from KSH. Could ayone please help me with this. Thanks (1 Reply)
Discussion started by: BlAhEr
1 Replies

10. Shell Programming and Scripting

Perl calling unix system commands

if ( system ("/bin/cat $File1 >> $File2") ) { print("#WARNING RAISED : /bin/cat File1 >> File2 - FAILURE!\n"); } I came across this code, would appreciate if someone can tell me if my understanding is correct? the perl code tell the system to cat file 1 into file 2, if command fails, print... (4 Replies)
Discussion started by: new2ss
4 Replies
Login or Register to Ask a Question