Bash Scripts-HowTo

Billy Pollifrone billy at silverbaseball.com
Mon Sep 11 12:52:50 BST 2006


It may be stupid of me, but I have to ask. Did you set the executable
bit for the script file?

- Billy

On 9/10/06, Leonard Chatagnier <lenc5570 at sbcglobal.net> wrote:
>
> > > > Chatagnier wrote:
> > > > > Would appreciate the correct command and
> > syntax
> > > >
> > > > I think you want:
> > > >
> > > > /bin/bash -c "sudo appname"
> > >
> > > Thanks for this. Will try it soon.
> > >
> > > > from the command line run a script with:
> > > > sh myscript.sh
> > >
> > > Are you saying that you can run the script from
> > the
> > > konsole with "sh myscript.sh" also in addition to
> > > "/bin/bash -c "sudo appname"". Sorry to be so dumb
> > on
> > > the subject but I only attempt to run script out
> > of
> > > absolute necessity.
> > >
> > > > If the script has the "shebang" line at the top,
> > > > then bash will use the
> > > > correct interpreter, and you can just run
> > ./myscript
> > > > e.g.
> > >
> > > Never seen the "shebang" line at top of any script
> > > file. guess I need to look harder. What I do see
> > at
> > > the top of most script files is "!/bin/sh". Could
> > you
> > > list at least one script in Kubuntu with that
> > > beginning line.?
> > >
> > > > #!/bin/bash
> > >
> > > Duhh, confused here; please stay with me. Is the
> > root
> > > command "!/bin/bash" the correct one to use and
> > not
> > > !/bin/sh?  At the start of every script file I
> > look
> > > at, is the command? !/bin/sh which I thought
> > > successfully ran the script in the past. Maybe I
> > > misremember. Would you please elaborate on this so
> > I
> > > may fully understand.
> > >
> > > > .....
> > > >
> > > > or for Perl scripts:
> > > >
> > > > #!/usr/bin/perl
> > > > .....
> > > >
> > > > Personally I like to use extensions like .sh or
> > .pl
> > > > so I know what kind
> > > > of script it is, but you don't need to.
> > >
> > > I haven't the slightest understanding of this.
> > > Guessing that .sh is a shell script and .pl is a
> > Perl
> > > script and each requires the correct command line
> > > syntax as you mentioned above.
> > >
> > > > Marcus
> > >
> > > Thanks for trying to help. Obviously I'm a hard
> > fix on
> > > this and have little knowledge on running scripts.
> > I'm
> > > open to any reference on running the script but
> > > definitely not writing or understanding what the
> > > script is doing. Thanks again.
> > This book will getyou started [it's a free download]
>
> Hello Grumpy Penguin. I really would like to check out
> the download book. However, I think you forget to add
> the link. Also, the title of the book would be nice to
> have. Thanks.
>
> > >
> > >
> > > Leonard Chatagnier
> > > lenc5570 at sbcglobal.net
> >
>
> Leonard Chatagnier
> lenc5570 at sbcglobal.net
>
> --
> kubuntu-users mailing list
> kubuntu-users at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kubuntu-users
>



More information about the kubuntu-users mailing list