Running an exe from a different folder
Am trying to run a exe on my unix machine from a different folder.
For instance,
i have a perl file in a folder /home/asif/runprj.pl which runs a exe in a different folder /home/projects/cobsat/a.out
and my perl file is something like this
#!/usr/bin/perl
system("/home/projects/cobsat/a.out");
now ...is there anyway I can run the exe by actually getting into the cobsat directory and simply execute ./a.out instead of runnin it with absolute path.
September 09, 2004 09:48 AM
Isn't it the same? I mean, you are executing it anyway by giving it the full path.
You can use the cd command to get into the map and then run it.
#!/usr/bin/perl
cd("/home/projects/cobsat");
system("a.out");
I think that will work....
You can use the cd command to get into the map and then run it.
#!/usr/bin/perl
cd("/home/projects/cobsat");
system("a.out");
I think that will work....
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement