Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to run a script in /etc/profile to setup aliases for all users login thru SSH. But this doesn't work:

setup_aliases.sh

#!/bin/bash
alias d='sh /opt/d/d.sh'
alias dc='d c'
alias de='d e'


------------
append this to: /etc/profile
. /opt/d/setup_aliases.sh

After login, I type 'd' but it says "command not found". Please help. Thanks. (I'm using Debian5)

share|improve this question

migrated from stackoverflow.com May 1 '11 at 20:27

This question came from our site for professional and enthusiast programmers.

1 Answer 1

You login as ? I'm assuming you log ing as root which

(a) by default skips some of the initialization scripts (like /etc/bash_completion e.g.) (b) might run a restricted shell

Could this be (related) to what is happening?

You could do

bash -x -l

to see what happens, and optionally save it to some location for insepction

share|improve this answer
    
thanks, bash -x -l helped me to debug the problem –  ipim.com May 1 '11 at 20:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.