Portál AbcLinuxu, 15. července 2025 15:50


Dotaz: fortune do .bashrc nebo .bash_profile?

21.9.2005 15:13 Lukáš Zapletal | skóre: 42 | blog: lzapův svět | Olomouc
fortune do .bashrc nebo .bash_profile?
Přečteno: 225×
Odpovědět | Admin
Mam dat volani "fortune" do .bashrc nebo .bash_profile? Protoze v bashrc je toto:
# This file is sourced by all *interactive* 
# bash shells on startup.  This file
# *should generate no output* or it will
# break the scp and rcp commands.
Muj bash_profile inkluduje bashrc. Neni mi zcela jasne toto (man bash):

When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of ~/.bashrc.

Znamena to tedy, ze se v tomto pripade nacte pouze .bashrc a ne bash_profile? Programy scp a rcp tedy ctou primo .bashrc?
Later --- Lukáš Zapletal
Nástroje: Začni sledovat (0) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

Vaclav Lesek avatar 21.9.2005 16:02 Vaclav Lesek | skóre: 11
Rozbalit Rozbalit vše Re: fortune do .bashrc nebo .bash_profile?
Odpovědět | | Sbalit | Link | Blokovat | Admin
Ja jsem vzdy programy, ktere jsem chtel spoustet, zapisoval do .bash_profile.
V tomto souboru je tento komentar:
# User specific environment and startup programs
21.9.2005 16:38 unchallenger | skóre: 69 | blog: unchallenger
Rozbalit Rozbalit vše Re: fortune do .bashrc nebo .bash_profile?
Odpovědět | | Sbalit | Link | Blokovat | Admin
Pokud nechceš, aby se fortuny vypisovaly při spuštění každého skriptu s #!/bin/bash na začátku (mimo jiné), tak by měla být volba jasná...
21.9.2005 16:44 Lukáš Zapletal | skóre: 42 | blog: lzapův svět | Olomouc
Rozbalit Rozbalit vše Re: fortune do .bashrc nebo .bash_profile?
A to? Potřebuju nakopnout. Pochopitelně jen po přihlášení v terminálu...
21.9.2005 16:47 VícNežNic | skóre: 42 | blog: Spáleniště | Ne dost daleko
Rozbalit Rozbalit vše Re: fortune do .bashrc nebo .bash_profile?
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
Copak toho není dost?
21.9.2005 16:45 Lukáš Zapletal | skóre: 42 | blog: lzapův svět | Olomouc
Rozbalit Rozbalit vše Re: fortune do .bashrc nebo .bash_profile?
Asi je ta moje volba zprávná...
lzap@teepee ~ $ bash
lzap@teepee ~ $ exit
lzap@teepee ~ $ bash -i
lzap@teepee ~ $ exit
lzap@teepee ~ $ bash -l
Je lépe radit se před činy, než potom o nich přemítat.
                -- Demokritos

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.