Bash scripting magic, can it be done?


Results 1 to 9 of 9

Thread: Bash scripting magic, can it be done?

  1. #1
    Join Date
    Sep 1999
    Location
    Santa Cruz, CA, USA
    Posts
    1,213

    Bash scripting magic, can it be done?

    Hello! Been a long while since I logged in here but now I have a (what I think is unique) problem to solve! Okay first some background:

    I have been writing my own applications using REAL Studio Professional as my IDE. It's quick, has a nice GUI interface and a pretty powerful RAD tool. I am running OpenSuSE 11.4 in a Windows/Macintosh environment at work (which is where I am having an issue I can't resolve at the moment).

    Now I have written several applications so far and they all work fine. Although there is an issue I can't seem to get resolved and I am still waiting for an answer from REAL Studio's as to how to fix it. The problem is I can't save a file to a remote Windows directory from any of my applications. Now in all but one I have got around this by writing a simple shell script then call it from my application. Works great... but this time it's not a solution as the destination is variable.

    So my question is, can I call a save or copy dialog box that will open an interface to allow me to select the file then the path I want to save to? The other variable is the file name is never going to be the same so I have to be able to select it from a window then select the path I want to save to.

    Now normally the application I am writing will do this, and it does so long as I keep the file on a local (in the physical machine) drive. I understand that Linux / Unix drives are transparent as to their location based on how the file system works, but for some reason the application I am writing... well it doesn't see that transparency.

    For more detail go here: http://forums.realsoftware.com/viewt...214641#p214641

    for the interim though is there a way to write a bash script to do what I need?
    One by one the penguins steal my sanity...

    Vanpooling now...

  2. #2
    Join Date
    Sep 1999
    Location
    Santa Cruz, CA, USA
    Posts
    1,213
    Hello? Is this thing on?
    One by one the penguins steal my sanity...

    Vanpooling now...

  3. #3
    Join Date
    Aug 1999
    Location
    Juneau, AK USA
    Posts
    780
    Do you have a file manager that allows right-click -> Save As...?
    We'll get thisright yet!

  4. #4
    Join Date
    Sep 1999
    Posts
    3,203
    Use zenity - there is a file picker and directory picker available in it

  5. #5
    Join Date
    Sep 1999
    Location
    Santa Cruz, CA, USA
    Posts
    1,213
    Quote Originally Posted by ph34r View Post
    Use zenity - there is a file picker and directory picker available in it
    This is exactly what I am looking for, although I am a bit cornfused. It worked the first time I ran it (to check it out) but now it's not. What I mean is I found this bit online:

    szSavePath=$(zenity --title="Save Difference Engine File(s)" --file-selection --save --confirm-overwrite);echo $szSavePath

    And it copied the files I selected just how I wanted it. But now it will open the select dialog and will not save the file where I tell it to. Doesn't matter where on the system it won't save. No error or anything.

    The video I am embedding shows the dialog opening, I select the file to be copied then the path where I want to copy it too. Then I drag Konqueror up and show how the file didn't copy. Now this is all through the application I have written that calls the zenity script.

    If I run the script by CLI, then all that happens is an echo of what I wanted will be printed but still no copy will happen.

    I'll post the vid in a bit... having issues with XVidCap now wanting to work properly.
    One by one the penguins steal my sanity...

    Vanpooling now...

  6. #6
    Join Date
    Sep 1999
    Location
    Santa Cruz, CA, USA
    Posts
    1,213
    Okay so I am muddling through this some more and while I can get dialog boxes to open and to select files (I am using KDialog now, KDE version of Zenity) I can't seem to find the one key to actually get the file to copy from point A to point B.

    So here is the vid I was yammering about earlier. Not sure what to do or how to do it as there are no real clear instructions on what I am trying to do.

    In the video you see me initiate KDialog from CLI. It opens just fine. Once it' open I navigate to where the files are that I want to copy. This location is on a local RAID drive. I select file I want to copy and then move up one level.

    Then I press save, once that is done the dialog closes and the CLI prompt shows the save output. But then I move down to Konqueror where you can see the source directory already open, then I move up a level where the file SHOULD be and it isn't... what am I doing wrong?

    One by one the penguins steal my sanity...

    Vanpooling now...

  7. #7
    Join Date
    Sep 1999
    Location
    Santa Cruz, CA, USA
    Posts
    1,213
    Floundering big time... how do I get the kdialog to actually copy the selected file from where I find it to where I want it? There has to be someway to get it to do this but I can't find any examples that even come close to doing what I need it to.
    One by one the penguins steal my sanity...

    Vanpooling now...

  8. #8
    Join Date
    Sep 1999
    Location
    Santa Cruz, CA, USA
    Posts
    1,213
    Still nothing? I still can't seem to find what I am looking for. As I noted I can get the dialog to display but I can't seem to get it to copy / move the selected file from point A to point B. I don't know how to do this, and I still haven't been able to figure it out...
    One by one the penguins steal my sanity...

    Vanpooling now...

  9. #9
    Join Date
    Sep 1999
    Location
    Cambridge, UK
    Posts
    509
    kdialog doesn't move files. It puts a dialog on the screen. You need to do the moving based on the output of kdialog.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •