Program won't open


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Program won't open
# 1  
Old 11-28-2011
Program won't open

When i run a program in terminal by typing in the entire path along with the program name for example

home/user/directory/subdirectory/program_name

I get this error:

Error initializing: File not found!

However when I change my directory to the directory of the program

cd /home/user/directory/subdirectory/

and then do

./program_name

it runs fine! Smilie

After a bit of research my hunch is that I need to change my PATH, but I'm not sure how to do that or if that is even my problem. Any suggestions?
# 2  
Old 11-28-2011
I have seen that type of error in poorly written applications that attempt to open a configuration file relative to the location of the executable.
# 3  
Old 11-28-2011
I agree that it is a message from the program, that makes sense. Unfortunately I didn't write this code, I'm just trying to modify it. What I'm attempting to do is run this program alongside another with a pipe using a similar command as this;

Code:
home/user/directory/subdirectory/program1 | home/user/directory/subdirectory/program2

But since "program1" won't open by just using it's path, is there a way to successfully open it using a pipe? Either that, or is there a way to modify my PATH to be able to open program 1 without being in it's directory? Thanks.
# 4  
Old 11-28-2011
This might work:

Code:
(cd /home/user/directory/subdirectory/; programme1)|home/user/directory/subdirectory/program2

This will run the first programme in a subshell after switching the current directory to the directory where the needed file(s) reside. The second programme is executed in with the cwd set to the one where you invoked the command.

If you have the source to programme1, it might be worth tracking down the source of the problem and modifying the code such that it doesn't need to have the current working directory house the needed file(s).
This User Gave Thanks to agama For This Post:
# 5  
Old 11-29-2011
COmbining the various ideas above and correcting the odd typo, this version stands a better chance:

Code:
(cd /home/user/directory/subdirectory/; ./program1)|/home/user/directory/subdirectory/program2

Part of your original problem could be the missing solidus at the start of each program path.

Last edited by methyl; 11-29-2011 at 05:02 PM.. Reason: remove bracket
This User Gave Thanks to methyl For This Post:
# 6  
Old 11-29-2011
That fix looks like it will probably work. I won't know for sure until tomorrow, so I'll update this post on the status of the problem. Thanks for your help!

Also, @methyl, I'm assuming there isn't supposed to be a ")" at the end of the code you posted earlier. Either that or you meant to put a "(" right after the "|" symbol. I think in either case it would work, it just needs to either have both parentheses or none.

Thanks again. Smilie


EDIT: That solution worked. Thanks guys!

Last edited by vjd5023; 12-01-2011 at 11:38 AM..
# 7  
Old 11-29-2011
Quite right. I have removed the trailing ")".
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash script won't run because hardware won't produce display

Can anyone offer any advice on how to modify the script below to work on a new system we have, that has no graphics capability? We admin the system through a serial RAS device. I've tried running the below script through the RAS and through an ssh -X session. It failed with something like "GTK... (3 Replies)
Discussion started by: yelirt5
3 Replies

2. Shell Programming and Scripting

Exit script and open program via other user

Hello all.. so i have a problem i need to solve .. #! /bin/bash $SHELL dtterm -title my_prog -e su -user -c 'export DISPLAY=:0.0 ; /path/to/my/prog' & 2> /dev/null $SHELL intr exit This script will work on solaris 10 system in right clikt menu - in a secure system so i need to... (0 Replies)
Discussion started by: defs
0 Replies

3. Fedora

How to use terminal while keeping a program open?

hi all, I open Matlab program from terminal. However, when I go back to terminal I can't do anything in it , only until Matlab is closed. Can someone please advise me on how I can oversome this problem ? thanks peter (2 Replies)
Discussion started by: peter_071
2 Replies

4. UNIX for Advanced & Expert Users

keep an open connection with scp or another similar program

Does anyone know a way to keep the connection open with scp? I really don't like having to type my password in every time I want to transfer a file. Or is there another similar program that will keep my connection open? (6 Replies)
Discussion started by: cokedude
6 Replies

5. UNIX for Dummies Questions & Answers

Xwindo won't open

When I boot I login as root at the console them select a second console and login as a user. After that is successful I start a window manager from /etc/X11/xinit by copying it to my .xinitrc. About half the time I have to go back to the root console and bring up a window manager from there then... (0 Replies)
Discussion started by: slak0
0 Replies

6. Shell Programming and Scripting

The script wont trigger it. Thief Catcher program (open source)

me and my team working on a project called Stealth Hunter, Summarize about our project: Stealth Hunter is a thief catcher, It will silently take a snapshot of user using a stolen notebook or pc with webcam and send the information via email. how it work is: The scripts will triggered by the... (0 Replies)
Discussion started by: Kiraichi
0 Replies

7. UNIX for Dummies Questions & Answers

Script to open program and send/execute command in program

Hi, i want to write a script that executes a program (exec?) . this program then requires a filename as input. how do i give it this input in the script so the program will be complete run and close by the script. e.g. exec prog.exe program then asks for filename "enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies

8. AIX

won't mount /usr...won't boot fully

Hello: NOOB here. I attempted to use smit mkcd. Failed on first attempt, not enough space. 2nd attempt tried to place iso on /usr, not enough space there. Cleanup ran for about 5 minutes after aborting. Now AIX won't boot. LCD display on 7029-6E3 says: 0517 MOUNT /USR. Attempted to boot from CD... (11 Replies)
Discussion started by: bbird
11 Replies
Login or Register to Ask a Question