[linux-l] Datum in Script verwenden

Pascal Volk linux-l at edelhost.de
Di Apr 10 16:02:57 CEST 2007


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

* Am Di, 10 Apr 2007 schrub Volker Grabsch:
> Falls das aus meinen Bemühungen nicht hervorging: Könntest du das
> bitte nochmals probieren?

Klar könnte ich das.

> Momentan zweifle ich immer noch daran, dass deine Bash sich wirklich
> so verhält. Kannst du es bitte nochmals ausprobieren? Hier nochmal
> der Testfall direkt als copy&paste-Code:
> 
> cat <<EOF >testscript
> #!`which bash`
> echo "hallo"
> EOF
> cat testscript
> 
> Würde mich echt interessieren. Die "man bash" sagt leider nichts dazu.
> Mal ne blöde Idee: Kann es sein, dass irgendeine Umgebungsvariable
> dieses Verhalten steuert?

Es kommt ganz darauf wie man Kommando absetzt, mit oder ohne
Anführungszeichen um das EOF.
Ursprünglich ging es um folgende Zeilen:
    pvo at el-presidente ~ $ cat >> testscript << "EOF"
    > #!`which bash`
    > echo "hallo"
    > EOF
    pvo at el-presidente ~ $ cat testscript 
    #!`which bash`
    echo "hallo"

So wie Du es schreibst, finden Ersetzungen statt:
    pvo at el-presidente ~ $ cat <<EOF >testscript
    > #!`which bash`
    > echo "hallo ${USER}"
    > EOF
    pvo at el-presidente ~ $ cat testscript 
    #!/bin/bash
    echo "hallo pvo"


Gruß
Pascal
- -- 
rm -Rfv /tmp/../ && echo "are you sure???"

Die BeLUG im IRC:
irc://irc.freenode.net/#belug
 ____ ____ ____ ____ ____ _________ ____ ____ ____ ____ ____ ____ 
 ||/ |||j |||o |||i |||n |||       |||# |||b |||e |||l |||u |||g ||
 ||__|||__|||__|||__|||__|||_______|||__|||__|||__|||__|||__|||__||
 |/__\|/__\|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|/__\|/__\|

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGG5kRNx2k6gsBqqkRAoe9AKCZV+1WfNwNA/vslVHHaJTuqTl/hACdFO7q
8jzrHy7EnZspxk5VoyjxPTU=
=/mWx
-----END PGP SIGNATURE-----



Mehr Informationen über die Mailingliste linux-l