Results 1 to 4 of 4

Thread: simple bash help needed

  1. #1
    Join Date
    Sep 2008
    Location
    Helsinki
    Posts
    88

    Default simple bash help needed

    Hello,

    I have written script for launching
    opnevpn that works in terminal (konsole).
    I want to have a file that i can click on
    in KDE (in dolphin of just as link icon)
    and that it would execute in terminal.

    What i tried: to make *.sh file, mark
    it as executable and click in dolphin
    or make a link. The result is nothing.

    Code:
    script:
    #!/bin/bash
    clear
    echo "Hello, starting up openvpn script"
    PTH=/etc/init.d/
    cd $PTH
    echo "running openvpn START:"
    echo
    sudo ./openvpn start
    echo
    system:
    opensuse 11.2
    GNU bash, version 4.0.35(1)-release (x86_64-suse-linux-gnu)
    Version 4.3.4 (KDE 4.3.4) "release 2"

  2. #2

    Default Re: simple bash help needed

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Did you make the script executable?

    chmod +x /path/to/your/script.sh

    I usually prefer to do this by putting the script somewhere such as in my
    user's home directory (~/bin) and then create a launcher/link in the GUI
    pointing to it.

    Also there is a programming/scripting forum you may want to use in the future.

    Good luck.






    On 02/17/2010 06:26 AM, Adenozinas wrote:
    >
    > Hello,
    >
    > I have written script for launching
    > opnevpn that works in terminal (konsole).
    > I want to have a file that i can click on
    > in KDE (in dolphin of just as link icon)
    > and that it would execute in terminal.
    >
    > What i tried: to make *.sh file, mark
    > it as executable and click in dolphin
    > or make a link. The result is nothing.
    >
    >
    > Code:
    > --------------------
    > script:
    > #!/bin/bash
    > clear
    > echo "Hello, starting up openvpn script"
    > PTH=/etc/init.d/
    > cd $PTH
    > echo "running openvpn START:"
    > echo
    > sudo ./openvpn start
    > echo
    > --------------------
    >
    >
    > system:
    > opensuse 11.2
    > GNU bash, version 4.0.35(1)-release (x86_64-suse-linux-gnu)
    > Version 4.3.4 (KDE 4.3.4) "release 2"
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.12 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQIcBAEBAgAGBQJLe/i1AAoJEF+XTK08PnB5laYP/2RyhnDGb/Wp7ZhFamhYfRjL
    xtbMEmYQ5bRoBw+0k7FwPbvx6GcMYyTNk52tzEIktyDbeG5w2ZF18VSdNpGn/drF
    jemQPnmxr709rvNX6NkIuWdpBhB7czc6Qh73k7z9gKlyl9IDazrejL4qmIqwVpf+
    nc1IrYoQg82/NW0t0iCr0djxXnpGSH2DVUURcLdlwpP0Qr7FujFZ8EjQwTSjjj2L
    1Hbso6DtlOYm0thSpIgI2GRVjUKL34iitF626patCn6w5tawM/YyIbhn1O0YGMhF
    S33aPv7HjsNTLjeGKjDvl37VVZafeCBZopIYpGsEH/t25zjsP2Bk1JxDDDhGdY9O
    vGzftwAKDTzLm/j76XgGAWCKBf6QOI0A4Sotohkij5kxBTShYefHfcnqsjfsdpk3
    fI5TVQB41BveGNd7k7Z0BOYzL+7KpjMvph6Kj4leG/Y0okHCiCyf3iEnQupWSp5q
    KZWKZCZjoVV4d7hra82zNHvsL0L7LemKubPCY4tPDNkVI7lirzKtjENsZw5NQPKH
    4HmwMw5vnS6OWW8tpHhDXv4JPHdoX3gWVMg4qMSGhtOhQ/RwqAis2eLMJvLZnZUN
    MI0N1MqVFxqAfqs6eXidwdsatpQsGCE5QgB0lJcDvcTrlbCbKxo2KlZ6R2nZuU+R
    PXub29pXgu8P5yjJDSW3
    =mY80
    -----END PGP SIGNATURE-----

  3. #3
    palladium NNTP User

    Default Re: simple bash help needed

    have you noticed this page http://forums.opensuse.org/ is a list of
    all the openSUSE forums..

    including http://forums.opensuse.org/programming-scripting/ where the
    folks very likely to be quickly helpful hang out...those same folks
    may or may not be here every hours or even every day....you are
    welcome to wait here or maybe a mod will move this posting for you..

    i can't answer your question, but wonder if the sample script you are
    following includes that "script:" at the very top?

    while waiting for competent help to drop in you might have a look at a
    guide which doesn't have that "script:" as the first thing

    here are two (of thousands) beginner bash scripting guide:
    http://tldp.org/LDP/Bash-Beginners-Guide/html/
    http://tille.garrels.be/training/bash/

    and here an advanced guide:
    http://tldp.org/guides.html

    i used YaST to install some documentation on my machine and here i
    have a rather complete bash guide including a section "3.8 Shell
    Scripts " at file:///usr/share/doc/packages/bash/bashref.html

    --
    palladium

  4. #4
    Join Date
    Sep 2008
    Location
    Helsinki
    Posts
    88

    Default Re: simple bash help needed

    Thanks a lot for help! I'll check out the forums
    that you both suggested!

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
  •