Re: (kill -1 $$)

From: Villy Kruse (vek_at_station02.ohout.pharmapartners.nl)
Date: 11/30/04


Date: 30 Nov 2004 09:31:12 GMT

On Tue, 30 Nov 2004 01:49:40 +0100,
    Stephen Riehm <stephen.riehm@gmx.net> wrote:

>
> Even this doesn't work:
>
> --- start
> sh
>
> cat << _EOF_ > ./suicidal_script.sh
> #!/bin/sh
> echo 2 $$
> kill -1 $$
> echo 3
> _EOF_
>
> chmod +x ./suicidal_script.sh
>

What do you get when you cat ./suicidal_script.sh ?
I would expect the $$ has been substituted by some number.

Try quote the _EOF_ string to avoid variabel substitutions.

cat << \_EOF_ > ./suicidal_script.sh
#!/bin/sh
echo 2 $$
kill -1 $$
echo 3
_EOF_

cat suicidal_script.sh



Relevant Pages

  • Re: take file name from command line arguement and write to file
    ... the Bourne Again Shell. ... > echo $a ... splitting, parameter substitutions etc. ... script and first sees the eval command, at first it behaves the usual ...
    (comp.unix.shell)
  • Re: something in awk that prints from $2 to NF
    ... It produces only the same results if substitutions have taken ... is also implicitly converted to a string, ... it's just 2 numbers (the sub() return and 1) which get string-concatenated ... $ echo X | nawk '"0"' ...
    (comp.unix.shell)
  • why "" in echo "$FOO" ?
    ... by a $ and surrounded by double quotes, as in echo "$FOO". ... you still want to e-mail me, cut out the extension from my address, ... and make the obvious substitutions on what's left. ...
    (comp.unix.shell)
  • Re: set user=%username%
    ... Your most recent feedback confirms that Windows is ... Type this: echo %MyName% ... > usertest=This is a long string. ...
    (microsoft.public.windows.server.general)
  • Re: its not the school home work
    ... I've learned a bit about strong quotes and think I realized when to ... the shell (such as in the $var, but also for the spaces (that ... echo "foo bar" ... you may say that $string does not appear in /list/ context so ...
    (comp.unix.shell)