running Bash file
Posted: Wed Oct 27, 2010 5:43 am
I'm sure that there is a really obvious answer, but as a Linux newbie, it's getting very frustrating. (I come from a windows background, and am therefore more used to batch files)
Essentially I have a process to run, that needs to be run multiple times, against multiple files. I have written a bash script to try and achieve this. It looks like:
[text]
#!/bin/bash
pxsqldump -d mysql -f /mnt/abc_xp/DB/AttachGrp.DB > /mnt/abc_xp/sql3/AttachGrp.sql;
pxsqldump -d mysql -f /mnt/abc_xp/DB/Attachment.DB > /mnt/abc_xp/sql3/Attachment.sql;
pxsqldump -d mysql -f /mnt/abc_xp/DB/AttachSrch.DB > /mnt/abc_xp/sql3/AttachSrch.sql;
. . .
[/text]
Basically it converts the .DB file to a .sql file. I have a copy of Ubuntu running in Virtualbox on my Windows XP machine. I use a shared folder so that the .DB files are on my windows machine, but are showing in Linux at /mnt/abc_xp/DB/
When I double click the file (bash.sh) in Linux it asks if I want to run it in the terminal, or display it etc.
I click run in terminal.
The terminal window opens and closes, but nothing happens.
If I paste the lines individually into a terminal window, they work fine.
I'm sure there must be a simple solution, but so far, I just can't find it.
Essentially I have a process to run, that needs to be run multiple times, against multiple files. I have written a bash script to try and achieve this. It looks like:
[text]
#!/bin/bash
pxsqldump -d mysql -f /mnt/abc_xp/DB/AttachGrp.DB > /mnt/abc_xp/sql3/AttachGrp.sql;
pxsqldump -d mysql -f /mnt/abc_xp/DB/Attachment.DB > /mnt/abc_xp/sql3/Attachment.sql;
pxsqldump -d mysql -f /mnt/abc_xp/DB/AttachSrch.DB > /mnt/abc_xp/sql3/AttachSrch.sql;
. . .
[/text]
Basically it converts the .DB file to a .sql file. I have a copy of Ubuntu running in Virtualbox on my Windows XP machine. I use a shared folder so that the .DB files are on my windows machine, but are showing in Linux at /mnt/abc_xp/DB/
When I double click the file (bash.sh) in Linux it asks if I want to run it in the terminal, or display it etc.
I click run in terminal.
The terminal window opens and closes, but nothing happens.
If I paste the lines individually into a terminal window, they work fine.
I'm sure there must be a simple solution, but so far, I just can't find it.