Getting a program to run


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Getting a program to run
# 1  
Old 06-08-2005
Question Getting a program to run

Please help, I have tried to run this program countless times and still nothing. Please tell me what I'm doing wrong.

$ cat>test
count=1
while [ $count -lt 10 ]
do
echo "5"
read number
echo $5
let count=count+ 1
done
exit 0
^C$ ksh test
$ ^C
$ ksh test
$
$ nothing happend
# 2  
Old 06-08-2005
There is a command called test. To run your test use a pathname.

ksh ./test
# 3  
Old 06-08-2005
Question

Thanks for the help,

but

Am I writing the script properly? when do I run ksh ./ test?

Please tell me what I'm doing wrong.
# 4  
Old 06-08-2005
Quote:
Originally Posted by ctiamaria
Please help, I have tried to run this program countless times and still nothing. Please tell me what I'm doing wrong.

$ cat>test
count=1
while [ $count -lt 10 ]
do
echo "5"
read number
echo $5
let count=count+ 1
done
exit 0
^C$ ksh test
$ ^C
$ ksh test
$
$ nothing happend
I notice a ^C at the end of this, did you type ^C or ^D ? ^C will abort the command and so the test file will not be created.
# 5  
Old 06-08-2005
I Pressed Ctrl-c to exit cat command then typed

ksh test (to run the program)

is this where my problem lies?
# 6  
Old 06-08-2005
Yes, type control D to end the cat command. Control C aborted it. Then type:
cat test
to make sure the file looks ok. Then when you run it, type:
ksh ./test
to see why. Type these commands:
ksh -c "type test"
ksh -c "type ./test"
# 7  
Old 06-09-2005
Thank you,

You been a great help. This can get nerve racking at times.

You made me hang in there by helping find out what I was doing wrong.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Run assembly program on debian?

Hi, I am new to assembly. What i need to install to run assembly program on debian 64? What i write to excite the code? (3 Replies)
Discussion started by: kaja
3 Replies

2. Shell Programming and Scripting

Can't get my program to run -- GC calculator?

have been trying for a few weeks not to get this program running. I am newer to programming and it has definitely been a challenge. I think my problem arises with my if statement. I can get it to append the name to the new file, but it simply appends the whole sequence to the file rather than... (3 Replies)
Discussion started by: haley6719
3 Replies

3. Shell Programming and Scripting

Using env variables to run a program

Hi there, I need urgent help with a small program that is run via shell script. Unfortunately I only understand the bare basics of shell scripting and can't figure out how to do this. We have a program that tests the connection between 3 servers. I have a script that lets the program run on... (15 Replies)
Discussion started by: Pherdinand
15 Replies

4. Shell Programming and Scripting

Run a program as another user

I have a bash script that launches another problem. I need to run that program under a certain user account. The script itself is run using 'sudo <scriptname>'. #!/bin/bash myprogram=... exec "$myprogram" How would this be done? (1 Reply)
Discussion started by: Carson Dyle
1 Replies

5. UNIX for Dummies Questions & Answers

Help to run this socket program in C

i have created two files named server and client then when i run the server program it says the server is waiting(./server 5555) then when i run the client program it says "client error:connection refused" can u plz help me to run it?:( (7 Replies)
Discussion started by: kedah160
7 Replies

6. UNIX for Dummies Questions & Answers

Log in, run program

Hey, im editing the passwd file so that when the user ben logs in it runs my assign program. I changed the last column from to Then when i log in i get... There is no problem with the program because it runs fine when i open it normally. Any help much appreciated. (8 Replies)
Discussion started by: RAFC_99
8 Replies

7. UNIX for Dummies Questions & Answers

cannot run program

Hi, I have a program in /opt/local/bin, my path in my .profile is export PATH=/opt/local/bin:/opt/local/sbin:$PATH however when i type the program name it cannot find it, however i know the program is in /opt/local/bin? Thanks (2 Replies)
Discussion started by: c19h28O2
2 Replies

8. Shell Programming and Scripting

how can i run java program from any where

Hello all sorry didnt know where to post it i compiled simple program that using "System.getProperty("user.dir");" now i compiled the program under directory foo and and its running great when i do "java myapp" i included this directory in the $PATH env variable so i could see it fro any where... (1 Reply)
Discussion started by: umen
1 Replies

9. UNIX for Dummies Questions & Answers

How do i run a program while in Unix?....

Im new and wanted to know if im in the unix terminal and lets say i want to run microsoft word for example. i go in and go into the HD and then keep going and i type ls and see that microsoft word.app is there. how do i run it from that? (4 Replies)
Discussion started by: Corrail
4 Replies

10. Programming

how to run debugging on c program

Can someone help me debug a c program I am running? It gives me segmentation fault. I want to turn on debugging. Can some one give the command to turn it on? Below is the error I get: Segmentation Fault (core dumped) (3 Replies)
Discussion started by: ibeg
3 Replies
Login or Register to Ask a Question