Bash script CD question
Hi,
(my first bash script and new to linux) I need a bash script which will do the following: Set the currect directory Run a program. The reason is that the program then uses the currect directory to locate the files it needs. I can execute the script but the cd command does not work, google did not realy help. I have set the path to the script file in my .profile so I just type the name of the script file in bash and it executes ok. that is when I'm at the moment. Any help would be much appreciated. Please use laymans terms in any reply :-) Thanks O |
Welcome to LQ
Could you post the script you have ? |
As repo wrote, it would help a lot if we could see the script.
Meanwhile Quote:
|
Quote:
This appears to be homework---Regardless, you need to tell us more about the context, show your work so far, and also tell us what books or reference material you are using. |
Quote:
Code:
#!/bin/bash Code:
$ . cd_and_run_program.sh |
Hi,
Welcome to LQ! So you've shown us your need! What's your deed? A few links to aid you in the future; Linux Documentation Project Rute Tutorial & Exposition Linux Command Guide Utimate Linux Newbie Guide LinuxSelfHelp Getting Started with Linux Advanced Bash-Scripting Guide These links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links! :hattip: |
Thanks
Hi,
Thanks for all the replies. As it turns out the issue was caused by the "Windows" line brake after the bash directive !! Once I converted it to unix the script ran as expected. Thanks again to everyone. O |
All times are GMT -5. The time now is 09:30 PM. |