[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash; nur eine variablen zuweisung



Moin,

* Roland M. Kruggel wrote (2006-11-27 16:05):
>Am Montag, 27. November 2006 15:59 schrieb Thorsten Haude:
>> Was ist das Ergebnis von
>>     foo=`tail -4 /var/log/auth.log`
>>     echo $foo >foo.out
>>     cat foo.out
>
>Das gleiche. Keine Linefeeds

Ok, bleibt noch
    tail -4 /var/log/auth.log > foo.out


>> Was sagt 'echo $IFS'?
>
>Ist ein Linefeed

Nur und ausschließlich ein Linefeed? Default sind unter der Bash
Space, Tab und Linefeed


>> Hast Du es mit $() versucht?
>
>Da weis ich jetzt nicht was du meinst

Du kannst statt Backticks auch $() benutzen, ich mag das lieber, weil
es deutlicher ist.
    foo=$(tail -4 /var/log/auth.log)


Thorsten
-- 
War is God's Way to teach geography to Americans.

Attachment: pgpPBmgfvLG_i.pgp
Description: PGP signature


Reply to: