Need help writing a shell script

This is a discussion about Need help writing a shell script in the Linux Software category; I'm just now trying to learn how to write shell scripts and would like some help. At our radio station, I needed a script that would copy our QuickBooks file, (running under Win4Lin), to back up to a usb reader writer stick.

Linux Software 434 This topic was started by , . Last reply by ,


data/avatar/default/avatar04.webp

1678 Posts
Location -
Joined 2003-09-27
I'm just now trying to learn how to write shell scripts and would like some help. At our radio station, I needed a script that would copy our QuickBooks file, (running under Win4Lin), to back up to a usb reader writer stick. The script, which is called "QBsave" is:

Code:
#!/bin/bashcp win/Program\ Files/Intuit/QuickBooks\ Pro/Wzla.QBW /mnt/usbstick/QBsave
When we execute this shell script from the IceWM menu, it does the job, although I'd like for it to do a little more. I would like a small window to come up which asks: "The file, "QBsave" already exists. Do you wish to overwrite it?"
And when you click "yes" the file is overwriten, and when you click "no", it isn't.
Anyone know how to do this? Thanks for any help.

Participate in our website and join the conversation

You already have an account on our website? To log in, use the link provided below.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This subject has been archived. New comments and votes cannot be submitted.
Jan 21
Created
Jan 23
Last Response
0
Likes
1 minute
Read Time
User User
Users

Responses to this topic


data/avatar/default/avatar02.webp

169 Posts
Location -
Joined 2003-03-02
add the -i option to copy.

Code:
#!/bin/bashcp -i  win/Program\ Files/Intuit/QuickBooks\ Pro/Wzla.QBW /mnt/usbstick/QBsave
Now write another script.

Code:
xterm -e <Name_Of_First_Script>
Note add both scripts to your $PATH.