-1

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)

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

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

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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