Jump to content

alias confusion [solved]


Recommended Posts

read the FAQ about this and in MDK10.1 /etc/profile.d/alias.sh exists

 

so i though ok su then add my own but that didnt work :(

 

so i made a user.sh in profile.d and only the firefox alias works???

 

 

Any ideas cause im really stuck, read about putting them in the .bash_profile will that work

Link to comment
Share on other sites

read the FAQ about this and in MDK10.1 /etc/profile.d/alias.sh exists

 

so i though ok su then add my own but that didnt work :(

it works if its rightly typed. BUT you need to re-source that file to make it's settings available to the current bash (or full login) session.

 

so i made a user.sh in profile.d and only the firefox alias works???

may you please post that file. We trust you but with that plain information we can't do anything :)

 

Any ideas cause im really stuck, read about putting them in the .bash_profile will that work

That depends for who do you want those aliased be available. If are just for your own user, place them in .bashrc which it's the natural place for aliases (of course you need to be sure that .bashrc get's sourced in a login session (but that's the default in Mdk). If the aliases are for everybody then place them at /etc/profile.d/alias.sh

 

Post the examples of what you are doing and we may better help you.

Edited by aru
Link to comment
Share on other sites

# Linux-Mandrake configuration: Chmouel Boudjnah <chmouel@mandrakesoft.com>

#

# Common Aliases for a system.

#

# The Semantic is :

# If exist a ~/.alias and the user hasn't specified a

# LOAD_SYSTEM_ALIAS variables then don't do any system aliases

# If there is no ~/.alias but the user has specified a

# IGNORE_SYSTEM_ALIASES then don't do any system aliases.

 

[[ -f ~/.alias ]] && [[ -z $LOAD_SYSTEM_ALIASES ]] && return 0

[[ -n $IGNORE_SYSTEM_ALIASES ]] && return 0

 

[ -e /etc/sysconfig/system ] && . /etc/sysconfig/system

 

if [ -f ~/.dir_colors ]; then

eval `dircolors --sh ~/.dir_colors`

else

eval `dircolors --sh /etc/DIR_COLORS`

fi

 

# default ls options

LS_OPTIONS="-F"

 

# this should be removed once the bug with ls and multibytes locales is fixed

[ -r /etc/profile.d/lang.sh ] && . /etc/profile.d/lang.sh

case "$LC_ALL$LC_CTYPE" in

ja*|ko*|zh*) LS_OPTIONS="$LS_OPTIONS --show-control-chars" ;;

*) if [ "`locale charmap`" = "UTF-8" ]; then

LS_OPTIONS="$LS_OPTIONS --show-control-chars"

fi ;;

esac

 

# emacs doesn't support color

if [ $TERM != "emacs" ];then

LS_OPTIONS="$LS_OPTIONS --color=auto"

fi

 

alias ls="ls $LS_OPTIONS"

 

alias d="ls"

alias l="ls" # classical listing.

alias ll="ls -l" # List detailled.

alias la='ls -a' # List all.

alias lsd="ls -d */" # List only the directory.

alias cd..="cd .."

alias s="cd .."

alias p="cd -"

 

alias md="mkdir"

alias rd="rmdir"

alias cp="cp -i"

alias mv="mv -i"

alias rm="rm -i"

alias firefox="/usr/share/firefox/firefox/firefox"

 

 

# Make a filter for less

if [ -x /usr/bin/lesspipe.sh ];then

export LESSOPEN="|/usr/bin/lesspipe.sh %s"

fi

 

if [ -n "$CLASS" -a "$CLASS" = "beginner" ];then

# Size of a directory (by default Human Readable).

alias du='du -h'

 

# Size of a disk (by default Human Readable).

# and don't probe supermount

alias df='df -h -x supermount'

fi

 

that is my alias.sh and this is my user.sh

alias firefox="/usr/share/firefox/firefox/firefox"

alias targz="tar -xzvf"

alias tarbz="tar -xjvf"

alias matt="cd /mnt/win_d/Documents\ and\ Settings/Matt/"

 

 

just noticed that ive duplicated the firefox entry is that the reason?

Edited by inflexion
Link to comment
Share on other sites

Your environment please? Are you login in rl5 or rl3, are you using gnome, kde, anyother. Does it happens too if you login in textmode. Also do you have a .alias file in your home directory or the environment variable $IGNORE_SYSTEM_ALIASES

 

notice that the better information you give us the faster we can solve your problem

Link to comment
Share on other sites

sorry i missed your point, im using kde on RL5 not tried text mode

and there is no .alias file in my home directory and ive got this in the alias.sh file right at the start, if this is what you mean?

 

 

[[ -f ~/.alias ]] && [[ -z $LOAD_SYSTEM_ALIASES ]] && return 0

[[ -n $IGNORE_SYSTEM_ALIASES ]] && return 0

 

[ -e /etc/sysconfig/system ] && . /etc/sysconfig/system

 

if [ -f ~/.dir_colors ]; then

eval `dircolors --sh ~/.dir_colors`

else

eval `dircolors --sh /etc/DIR_COLORS`

fi

Link to comment
Share on other sites

alias targz="tar -xzvf"

alias tarbz="tar -xjvf"

alias matt="cd /mnt/win_d/Documents\ and\ Settings/Matt/"

 

Adding those right after the firefox alias in alias.sh didn't work? Add them there and then do (as your regular user):

 

. /etc/profile.d/alias.sh

 

There is a space between the . and the /

Link to comment
Share on other sites

thanks seams to be working, ill see if i reboot changes that :P

It will.

 

If you boot into runleve 3 I'm sure it will work, and if you boot into another desktop it will work too, but I guess it will fail for KDE, there is an issue with bash login shells and the way kde is run.

 

this has been asked several times, let's see if I quickly find any of those posts (I'm in a hurrry...)...

 

...OK this is the post: http://mandrakeusers.org/index.php?showtop...indpost&p=12531

 

HTH

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...