Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Start application from a inside a folder

  1. #1
    Join Date
    Mar 2009
    Location
    Caribbean
    Posts
    242

    Default Start application from a inside a folder

    Hi Guys,

    Fairly simple to Linux users but to me.

    I want to run a bin file from a folder. It can oly work while you are in that folder.

    So use the command /home/user/Applications/furiusisomount-0.11.1.1/ && sh /home/user/Applications/furiusisomount-0.11.1.1/furiusisomount

    That works perfectly from the console. But if i add that as a launcher it never works.

    any ideas??

    Thanks in advanced
    Opensuse 11.3 KDE 4.4.4, Windows XP. Vostro 1500 with 2.0Ghz Core2Duo and 8400M GS and DELL wireless 1390 Card
    Office: PCLinuxOS KDE 4.3.5 Whitebox, 2GB RAM, 2.8GHz Pentium 4

  2. #2

    Default Re: Start application from a inside a folder

    You use sh so I would guess you guess the && is causing issues you should have little trouble also && is do unless previous fails. I also suspect this is a cd (Where you have command) this shouldn't be needed sh /the/whole/path should work fine. Or add the shebang !#/bin/bash and change the execute bits then the sh shouldn't be needed.

    Also you maybe able to work around it by creating a sym link in ~/bin as this will be in your path after setting the exec bit.
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

  3. #3
    Join Date
    Mar 2009
    Location
    Caribbean
    Posts
    242

    Default Re: Start application from a inside a folder

    Hey thanks for the reply. I didnt have to use sh /the/whole/filepath/ like you said. But the rest of your reply is kinda confusing. Can you clarify what you were saying a bit more for me please?

    Plus how do i create that sym link?
    Opensuse 11.3 KDE 4.4.4, Windows XP. Vostro 1500 with 2.0Ghz Core2Duo and 8400M GS and DELL wireless 1390 Card
    Office: PCLinuxOS KDE 4.3.5 Whitebox, 2GB RAM, 2.8GHz Pentium 4

  4. #4
    Join Date
    Apr 2009
    Location
    Memphis, TN
    Posts
    62

    Default Re: Start application from a inside a folder

    I run the bin file for songbird. I basically clicked and dragged the bin file from the folder to the toolbar. This made a copy and it is working fine for me. I didn't go through the hassle of manually creating a launcher for it.
    System: IntelCore 2 Quad 6600, Asus P5Q Deluxe,8 GB Corsair XMS, NVidia GTS 250 512Mb
    OS: OpenSuse 11.1 x64; 2.6.27...; KDE 4.3 Dual-boot w/ Windows 7 RC

  5. #5

    Default Re: Start application from a inside a folder

    Well the sym link shouldn't really be necessary unless you use the terminal and want to use theappsname to call it like other cli apps.

    If you did then you just need ... OK just tested that this may depend on the data(It started but I'm missing bits) so the simple way would be to create a script. Put this in ~/bin and change it to execute use your favourite filemanager or chmod.

    Code:
    #!/bin/bash
    ./the/path/to/the/exe
    # You can also do it as so, the above presumes the exe bit is set.. Then a filebrowser will be able to click it.
    sh /the/to/the/exe
    OT (Well now it is)
    ln -s /the/path/to/the/exe /home/$user/bin/exe
    This would create a sym link but depending on the exe may well not work if it needs the data folders.

    Edit
    The launcher should be easy to create now with out the cd && it should just start(Though getting rid of the sh and adding the shebang and adding the excute bit may make it work easier still), otherwise you can do as suggested an create a little launch script that may well make it easier still.
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

  6. #6
    Join Date
    Mar 2009
    Location
    Caribbean
    Posts
    242

    Default Re: Start application from a inside a folder

    Quote Originally Posted by atraller47 View Post
    I run the bin file for songbird. I basically clicked and dragged the bin file from the folder to the toolbar. This made a copy and it is working fine for me. I didn't go through the hassle of manually creating a launcher for it.
    Well, it just doesnt' start. This binary file needs the data files associated with it to start

    Now FeatherMonkey. I tried to create the script trying to do exactly what you told me.

    Still no luck. But i most likely am doing something wrong. This is how my script looks like:

    #!/bin/bash
    ./home/sebastien/Applications/furiusisomount-0.11.1.1/
    # You can also do it as so, the above presumes the exe bit is set.. Then a filebrowser will be able to click it.
    sh /home/sebastien/Applications/furiusisomount-0.11.1.1/furiousmount

    is this correct. I've used chmod 755 settings on the file

    I get this error when i run it:

    /bin/Test: line 2: ./home/sebastien/Applications/furiusisomount-0.11.1.1/: No such file or directory
    sh: /home/sebastien/Applications/furiusisomount-0.11.1.1/furiousmount: No such file or directory
    Opensuse 11.3 KDE 4.4.4, Windows XP. Vostro 1500 with 2.0Ghz Core2Duo and 8400M GS and DELL wireless 1390 Card
    Office: PCLinuxOS KDE 4.3.5 Whitebox, 2GB RAM, 2.8GHz Pentium 4

  7. #7
    Join Date
    Mar 2009
    Location
    Caribbean
    Posts
    242

    Default Re: Start application from a inside a folder

    LOL

    I know the mistake. I spelt it wrong. I got the script to run. THANK YOU. Now to make it a shortcut.....
    Opensuse 11.3 KDE 4.4.4, Windows XP. Vostro 1500 with 2.0Ghz Core2Duo and 8400M GS and DELL wireless 1390 Card
    Office: PCLinuxOS KDE 4.3.5 Whitebox, 2GB RAM, 2.8GHz Pentium 4

  8. #8

    Default Re: Start application from a inside a folder

    Glad you're sorting it, still surprised you couldn't just create the shortcut/launcher with one of the commands(They both do the same)

    sh is as you did it, this is normally done if the execute bit isn't set i.e clicking in browser doesn't launch it. If the execute bit is set and it still doesn't launch then it'll need the shebang line first line in the script #!/bin/bash. Then the first line will work which is ./the/script.

    Then further in using bin makes it unnecessary to use ./the/script so really we have the 3 different ways of running

    ./the/script = run this script needs the shebang line and execute bit note the fullstop at the beginning

    sh /the/script = use sh to execute the/script

    script = where it would be in the bin or specifically $PATH (Like . needs the shebang and execute bit)
    As ~/bin is in the users path, you can also do things like adding to your default path but some thought needs to be taken. I tend to think of it as a last resort and wouldn't actually amend my $PATH unless nothing else worked.
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

  9. #9
    Join Date
    Mar 2009
    Location
    Caribbean
    Posts
    242

    Default Re: Start application from a inside a folder

    Yea, i just used the "command" that I put in the bin folder as the launcher and it worked perfectly.

    I'm wondering though, I have a linux server that I have to keep starting a service manually. how can I write the script that allows me to run a a command as a specific user while still having to use a specific directory to a file from another directory?
    Opensuse 11.3 KDE 4.4.4, Windows XP. Vostro 1500 with 2.0Ghz Core2Duo and 8400M GS and DELL wireless 1390 Card
    Office: PCLinuxOS KDE 4.3.5 Whitebox, 2GB RAM, 2.8GHz Pentium 4

  10. #10

    Default Re: Start application from a inside a folder

    Mmm going to need a proper guru ...

    As for the bits of a data folder I see 2 ways I had the same problem I have a game installed in ~ so threw my off the cuff statement about ln -s which didn't work...

    Now I can create the link fine but unless I goto the data folder it won't work so it would involve a script to cd to the folder then execute.

    The better way would be if the app can actually take a --data folder flag then you could just call it that would depend on the app.

    Now the troublesome bit is the start as another user, here I would look at sudo I suspect you maybe able to configure it to run as user x, but most of the time it as root, but I do remember the sudoers gui having lots of other bits. Now hopefully that lot works and you can just use sudo /the/command and it'll run as the user you specify if not... Well that creates a big security hole for me, you need to get around using the user password and using su user first. To get around it and I do not recommend it you would need to look at things like the expect module which you'll find for a variety of languages.
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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