Results 1 to 8 of 8

Thread: Root Bash Scripting

  1. #1

    Default Root Bash Scripting

    How do i run bash script as root? Or login as root on the script using either sudo or su? Which is better/easier? I need to run the command avggui as root.

    Thanks for any help

  2. #2
    Join Date
    Jan 2008
    Location
    U.K East Anglia
    Posts
    2,581

    Default Re: Root Bash Scripting

    su would be better

    Andy
    To be is to do = Immanuel Kant
    To do is to be = Descartes.
    Do be do be do = Frank Sinatra

    SuSE user since 7.0,Linux user since 1994

  3. #3
    ab@novell.com NNTP User

    Default Re: Root Bash Scripting

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

    su -
    #enter password
    /path/to/avggui

    Good luck.




    DrEaMeR23 wrote:
    > How do i run bash script as root? Or login as root on the script using
    > either sudo or su? Which is better/easier? I need to run the command
    > avggui as root.
    >
    > Thanks for any help
    >
    >

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

    iD8DBQFIvXQl3s42bA80+9kRAhLoAJ48S5I898krcQ9OkYV1AjWxD8T2HwCcCJiH
    wv1roqwUOAlwf6fIaRqqADY=
    =cXQo
    -----END PGP SIGNATURE-----

  4. #4

    Default Re: Root Bash Scripting

    right i have the script:
    su
    password
    .//opt/grisoft/avggui/bin/avggui
    is this right? because it doesnt run when i click the icon. or when i use the command ./AVG_Antivirus.sh(thats the filename) wherever the file is situated.
    is there a way to run the commands as root without using a terminal? could i run the file as root?

  5. #5
    ab@novell.com NNTP User

    Default Re: Root Bash Scripting

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

    Alt+F2
    gnomesu /path/to/the/file
    or
    kdesu /path/to/the/file

    Good luck.





    DrEaMeR23 wrote:
    > right i have the script:
    >> su
    >> password
    >> .//opt/grisoft/avggui/bin/avggui

    > is this right? because it doesnt run when i click the icon. or when i
    > use the command ./AVG_Antivirus.sh(thats the filename) wherever the file
    > is situated.
    > is there a way to run the commands as root without using a terminal?
    > could i run the file as root?
    >
    >

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

    iD8DBQFIvrI23s42bA80+9kRAstaAJ9FK51tq0L1YQrwLdsOUN+wMWFbEwCghu2i
    tN4RHxnDwUyEgvHcFRTMhKo=
    =Dxvn
    -----END PGP SIGNATURE-----

  6. #6

    Default Re: Root Bash Scripting

    ah ok. ive done that. thanks. is there anyway to do that without having to input my root password?

  7. #7
    ab@novell.com NNTP User

    Default Re: Root Bash Scripting

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

    right-click on desktop, create launcher, put command in 'Command' field,
    eat chocolate chip cookies and/or ice cream without caramel,
    double-click on new icon, enter password, enjoy.

    Good luck.





    DrEaMeR23 wrote:
    > that worked. How do i put it into one file or whatever so i can just
    > click an icon and it runs?
    >
    >

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

    iD8DBQFIvsKS3s42bA80+9kRAjcuAJ986Y5WDfrWbJEYyW8olLjI/vvqEwCfRmhA
    i0cTLWqC9lMp2OC9Z7INZdg=
    =joLU
    -----END PGP SIGNATURE-----

  8. #8
    ab@novell.com NNTP User

    Default Re: Root Bash Scripting

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

    `man audo`
    `man sudoers`

    Good luck.





    DrEaMeR23 wrote:
    > ah ok. ive done that. thanks. is there anyway to do that without having
    > to input my root password?
    >
    >

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

    iD8DBQFIvsVk3s42bA80+9kRAhSWAJ47R2pZs9jU4RuH3GMH+U2Ux7ZFBACfSX1A
    bRRQa8686Xi9eL23xva7nG8=
    =356V
    -----END PGP SIGNATURE-----

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
  •