All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Hazelton <dhazelton@enter.net>
To: Shu Wu <superwushu@gmail.com>
Cc: Stepan Chatalyan <kehcho@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: Hi all, bug or design flaw?
Date: Thu, 21 Jan 2010 21:15:30 -0500	[thread overview]
Message-ID: <201001212115.31055.dhazelton@enter.net> (raw)
In-Reply-To: <5c7d4fb81001211800k2bf2025bqea45a78292da2199@mail.gmail.com>

On Thursday 21 January 2010 09:00:15 pm Shu Wu wrote:
> Hey, buddy, this is not the right place to raise a user-space
> question. But as for your question, you'd better to learn what the "."
> means. "#!/bin/bash" is used to indicate in shell when executed, while
> to be just a comment in the latter.
> 
> 2010/1/22 Stepan Chatalyan <kehcho@gmail.com>:
> > Hi there,
> >
> > I'm Stepan G. Chatalyan, and i think that I discovered a bug or design
> > flaw... and I don't know that it is provide from kernel...
> >
> > Let's see:
> >
> > (1) I mount /tmp with noexec,nosuid,nodev options
> >
> > /dev/hda6 on /tmp type ext3 (rw,noexec,nosuid,nodev,relatime)
> >
> > (2) I went to 'cd /tmp'`and I created a bash script, or another script
> > (perl, python, etc)... and chmod +x createdfile
> > script cointain:
> >
> > #!/bin/bash
> > echo "Probe..."
> >
> > (3) I tried to execut it with "./createdfile"
> > [kehcho@kehcho] [/tmp]$ ./createdfile
> > -bash: ./createdfile: /bin/bash: bad interpreter: Permission denied
> >
> > (4) I tried to execute it, but pass to bash ". /tmp/createdfile"
> >
> > [kehcho@tornadowt] [/tmp]$ . /tmp/createdfile
> > Probe...
> >
> > It is a kernel bug or I just report a another one?

This is not a bug at all. I'll just repeat Shu Wu's statement - learn what "." 
actually does. Note: it is *NOT* the same as $(...) or `...` - and it is not 
the same as directly executing a script.

DRH

  reply	other threads:[~2010-01-22  2:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22  1:05 Hi all, bug or design flaw? Stepan Chatalyan
2010-01-22  1:12 ` andrew hendry
2010-01-22  1:25 ` Al Viro
2010-01-22  2:00 ` Shu Wu
2010-01-22  2:15   ` Daniel Hazelton [this message]
2010-01-22  2:25   ` Américo Wang
2010-01-22 11:30 ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201001212115.31055.dhazelton@enter.net \
    --to=dhazelton@enter.net \
    --cc=kehcho@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=superwushu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.