* getting at raw command line
@ 2007-09-13 12:18 Jack Andrews
2007-09-13 13:50 ` Lukas
[not found] ` <316574.13339.qm@web50312.mail.re2.yahoo.com>
0 siblings, 2 replies; 7+ messages in thread
From: Jack Andrews @ 2007-09-13 12:18 UTC (permalink / raw)
To: linux-assembly
hi there,
is there a way to get the raw text that eventually gets cooked to
argc/argv? is there any portable way?
ta,
jack
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: getting at raw command line
2007-09-13 12:18 getting at raw command line Jack Andrews
@ 2007-09-13 13:50 ` Lukas
[not found] ` <316574.13339.qm@web50312.mail.re2.yahoo.com>
1 sibling, 0 replies; 7+ messages in thread
From: Lukas @ 2007-09-13 13:50 UTC (permalink / raw)
To: linux-assembly
I don't know if i understand your question ... every
command line arguments you pass to program in Linux,
are left on the stack ( actualy they are pointers to
asciz strings )
Lukas
--- Jack Andrews <effbiae@gmail.com> wrote:
> hi there,
>
> is there a way to get the raw text that eventually
> gets cooked to
> argc/argv? is there any portable way?
>
> ta,
>
>
> jack
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-assembly" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
>
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: getting at raw command line
[not found] ` <316574.13339.qm@web50312.mail.re2.yahoo.com>
@ 2007-09-13 15:01 ` Jack Andrews
2007-09-13 15:46 ` Gerardo García Peña
2007-09-13 17:15 ` Lukas
0 siblings, 2 replies; 7+ messages in thread
From: Jack Andrews @ 2007-09-13 15:01 UTC (permalink / raw)
To: linux-assembly
the shell changes arguments like * to a number of arguments. is there
a way to get the *? that is, if my program is p, i want this
behaviour:
$ ls
file.1 file.2
$ ls *
file.1 file.2
$ p file.1
file.1
$ p *
*
i don't want
$ p *
file.1 file.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: getting at raw command line
2007-09-13 15:01 ` Jack Andrews
@ 2007-09-13 15:46 ` Gerardo García Peña
2007-09-13 17:15 ` Lukas
1 sibling, 0 replies; 7+ messages in thread
From: Gerardo García Peña @ 2007-09-13 15:46 UTC (permalink / raw)
To: linux-assembly
Jack Andrews escribió:
> the shell changes arguments like * to a number of arguments. is there
> a way to get the *? that is, if my program is p, i want this
> behaviour:
>
> $ ls
> file.1 file.2
> $ ls *
> file.1 file.2
> $ p file.1
> file.1
> $ p *
> *
>
> i don't want
>
> $ p *
> file.1 file.2
> -
> To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Wildcard expansion is not responsability of Unix/Operating System... it
is done by the shell (bash)
if you try
ls '*'
you will get:
ls: *: No such file or directory
and if you try
p '*'
*
You can also escape wildcard expansion in these ways:
ls '*'
ls "*"
ls \*
luck,
ge
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: getting at raw command line
2007-09-13 15:01 ` Jack Andrews
2007-09-13 15:46 ` Gerardo García Peña
@ 2007-09-13 17:15 ` Lukas
2007-09-13 17:20 ` Lukas
1 sibling, 1 reply; 7+ messages in thread
From: Lukas @ 2007-09-13 17:15 UTC (permalink / raw)
To: linux-assembly
As i said, when you start program 'p whatever ' %esp
points place on stack where number of parameters was
put ex.
$p 1 2 3 -> movl (%esp),%ecx => %ecx=3 )
next (%esp+4) adress of program name ex.
$/home/usr/bin/p 1 2 3 -> (%esp+4) adres of string
"/home/usr/bin/p"
(%esp+8)(+16 if you have 64-bit arch) adress of text
string of first parameter, so if you write
$ p * -> movl (%esp+8),%ecx / movq (%rsp+16),%rcx
movl (%ecx),%ebx / movq (%rcx),%rbx
%ecx=42 ( '*' )
so now you can do with it whatever you want ( write
using SYS_WRITE, printf etc )
Lukas
--- Jack Andrews <effbiae@gmail.com> wrote:
> the shell changes arguments like * to a number of
> arguments. is there
> a way to get the *? that is, if my program is p, i
> want this
> behaviour:
>
> $ ls
> file.1 file.2
> $ ls *
> file.1 file.2
> $ p file.1
> file.1
> $ p *
> *
>
> i don't want
>
> $ p *
> file.1 file.2
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-assembly" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
>
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell.
http://searchmarketing.yahoo.com/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: getting at raw command line
2007-09-13 17:15 ` Lukas
@ 2007-09-13 17:20 ` Lukas
2007-09-13 17:32 ` Lukas
0 siblings, 1 reply; 7+ messages in thread
From: Lukas @ 2007-09-13 17:20 UTC (permalink / raw)
To: linux-assembly
of course in last line of "code" ;) should be %ebx=42
regards
Lukas
--- Lukas <blurrpp@yahoo.com> wrote:
> As i said, when you start program 'p whatever ' %esp
> points place on stack where number of parameters was
> put ex.
> $p 1 2 3 -> movl (%esp),%ecx => %ecx=3 )
>
> next (%esp+4) adress of program name ex.
>
> $/home/usr/bin/p 1 2 3 -> (%esp+4) adres of string
> "/home/usr/bin/p"
>
> (%esp+8)(+16 if you have 64-bit arch) adress of text
> string of first parameter, so if you write
>
> $ p * -> movl (%esp+8),%ecx / movq (%rsp+16),%rcx
> movl (%ecx),%ebx / movq (%rcx),%rbx
> %ecx=42 ( '*' )
> so now you can do with it whatever you want ( write
> using SYS_WRITE, printf etc )
> Lukas
>
>
> --- Jack Andrews <effbiae@gmail.com> wrote:
>
> > the shell changes arguments like * to a number of
> > arguments. is there
> > a way to get the *? that is, if my program is p,
> i
> > want this
> > behaviour:
> >
> > $ ls
> > file.1 file.2
> > $ ls *
> > file.1 file.2
> > $ p file.1
> > file.1
> > $ p *
> > *
> >
> > i don't want
> >
> > $ p *
> > file.1 file.2
> > -
> > To unsubscribe from this list: send the line
> > "unsubscribe linux-assembly" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at
> > http://vger.kernel.org/majordomo-info.html
> >
>
>
>
>
>
____________________________________________________________________________________
> Pinpoint customers who are looking for what you
> sell.
> http://searchmarketing.yahoo.com/
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-assembly" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
>
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: getting at raw command line
2007-09-13 17:20 ` Lukas
@ 2007-09-13 17:32 ` Lukas
0 siblings, 0 replies; 7+ messages in thread
From: Lukas @ 2007-09-13 17:32 UTC (permalink / raw)
To: linux-assembly
and again wrong ... (to fast:) ) ... %bl=42,%bh=0 :D
Lukas
--- Lukas <blurrpp@yahoo.com> wrote:
> of course in last line of "code" ;) should be
> %ebx=42
>
> regards
> Lukas
>
> --- Lukas <blurrpp@yahoo.com> wrote:
>
> > As i said, when you start program 'p whatever '
> %esp
> > points place on stack where number of parameters
> was
> > put ex.
> > $p 1 2 3 -> movl (%esp),%ecx => %ecx=3 )
> >
> > next (%esp+4) adress of program name ex.
> >
> > $/home/usr/bin/p 1 2 3 -> (%esp+4) adres of string
> > "/home/usr/bin/p"
> >
> > (%esp+8)(+16 if you have 64-bit arch) adress of
> text
> > string of first parameter, so if you write
> >
> > $ p * -> movl (%esp+8),%ecx / movq (%rsp+16),%rcx
> > movl (%ecx),%ebx / movq (%rcx),%rbx
> > %ecx=42 ( '*' )
> > so now you can do with it whatever you want (
> write
> > using SYS_WRITE, printf etc )
> > Lukas
> >
> >
> > --- Jack Andrews <effbiae@gmail.com> wrote:
> >
> > > the shell changes arguments like * to a number
> of
> > > arguments. is there
> > > a way to get the *? that is, if my program is
> p,
> > i
> > > want this
> > > behaviour:
> > >
> > > $ ls
> > > file.1 file.2
> > > $ ls *
> > > file.1 file.2
> > > $ p file.1
> > > file.1
> > > $ p *
> > > *
> > >
> > > i don't want
> > >
> > > $ p *
> > > file.1 file.2
> > > -
> > > To unsubscribe from this list: send the line
> > > "unsubscribe linux-assembly" in
> > > the body of a message to
> majordomo@vger.kernel.org
> > > More majordomo info at
> > > http://vger.kernel.org/majordomo-info.html
> > >
> >
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Pinpoint customers who are looking for what you
> > sell.
> > http://searchmarketing.yahoo.com/
> > -
> > To unsubscribe from this list: send the line
> > "unsubscribe linux-assembly" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at
> > http://vger.kernel.org/majordomo-info.html
> >
>
>
>
>
>
____________________________________________________________________________________
> Need a vacation? Get great deals
> to amazing places on Yahoo! Travel.
> http://travel.yahoo.com/
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-assembly" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
>
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-09-13 17:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-13 12:18 getting at raw command line Jack Andrews
2007-09-13 13:50 ` Lukas
[not found] ` <316574.13339.qm@web50312.mail.re2.yahoo.com>
2007-09-13 15:01 ` Jack Andrews
2007-09-13 15:46 ` Gerardo García Peña
2007-09-13 17:15 ` Lukas
2007-09-13 17:20 ` Lukas
2007-09-13 17:32 ` Lukas
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.