troubleshooting Question

bash script to cd into a dir and fire an app.

Avatar of samj
samj asked on
Linux OS Dev
34 Comments1 Solution2132 ViewsLast Modified:

I have a program writting in c++ which has I compiled and it is
setting in a directory called myProg/str1/ the compiled file is called

I need to fire it up on starting xterm as well as on boot up. the program prints out a menu and waits
for user selection. so I need to fire it up under xterm. by first
going to the directory and then firing the proj application.

working under fedora core 5 "linux".

at the end of my .bash_profile I have the line
xterm &

which starts xterm.

in  .bashrc (which is used by xterm ever time it starts) I

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
      . /etc/bashrc

# User specific aliases and functions

cd myProg/str1/
/sbin/fuser ./proj >/dev/null || ./proj

that works when I fire up xterm. but the problem is when I reboot I
get a bank green screen with the mouse only and nothing else. I have
to Alt-Ctl f11 and Alt-right_arrow to a console and login/emacs/edit
the .bashrc (comment out the last line above) reboot. then I get an
xterm showing

bash: cd: myProg/str1/: No such file or directory
[fred@localhost str1]$

so it changed the dir to what I want but did not fire the program. but
then whats this first line above mean.
anyway, how can I fix this.


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 34 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 34 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros