This is G o o g l e's cache of http://www.debianclub.com/node/31 as retrieved on 17 Feb 2007 15:03:18 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?hl=en&q=cache%3Ahttp%3A%2F%2Fwww.debianclub.com%2Fnode%2F31&btnG=Search


Google is neither affiliated with the authors of this page nor responsible for its content.

User login

Links

debianclub.com
debian.org
ubuntuclub.com
blognone.com

Syndicate

Syndicate content

.bashrc ไม่ยอมรันตอน login ครับ

ตอน ผม login มันไม่ run .bashrc อ่ะ ครับ
.bash_profile ก็มีแล้ว ทำ ยัง ดี ครับ

default shell

ผมแก้ดื้อ ๆ เลย (ไม่แน่ใจว่าวิธีการถูกหรือเปล่า)
$ sudo usermod -s /bin/bash USERNAME

ล๊อกอินครั้งต่อไป ก็ใช้งาน .bashrc และ .bash_profile ได้แล้วครับ

ขอบคุณครับ

ถูกผิดไม่รู้ เหมือนกันครับ
แต่มันใช้ได้ดี ครับ ขอบคุณมากครับ

เข้าใจว่า...

อืม...ตาม ความเข้าใจของผม ~/.bash_profile จะเป็นไฟล์ที่ถูกรันทุกครั้งที่ login ด้วย bash ที่นี้ถ้า .bashrc ไม่ทำงานก็ต้องไปดูใน ~/.bash_profile ว่ามีบรรทัดแบบนี้ในนั้นรึป่าว


if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi


sh VS bash

ผมก็ยังงงกับเรื่องนี้เหมือนกันนะครับ
(ในไฟล์ ~/.bash_profile มีบรรทัดที่ว่าอยู่แล้วครับ)
ที่งงก็คือ ค่าเชลล์ปกติที่ระบบทำให้กับ user คือ /bin/sh
ซึ่งจริง ๆ มันก็เป็นแค่ลิงก์ไปยัง /bin/bash อีกทีนึง
แต่เวลาเราแก้ไข ~/.bashrc แล้ว ระบบไม่ยอมทำตามที่เราแก้ไขไว้
แต่พอเปลี่ยนเชลล์ของเราเป็น bash (ดูจาก /etc/passwd) คราวนี้ถึงจะเป็นไปตามที่เราตั้งค่าไว้
...
แปลกดี

argv[0]

แสดงว่า bash มันแยก argv[0] แล้วแยกทำตัวเป็น bash หรือ bourne shell ธรรมดาน่ะสิครับ (เพิ่งรู้เหมือนกันนะนี่)