LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-15-2004, 09:53 AM   #1
mooreted
Member
 
Registered: May 2003
Posts: 598

Rep: Reputation: 30
Angry Global Aliases--Nothing is working!


I followed every instruction here for creating aliases and none of them work.

Here's what I want to do:

Open Konqueror
Open a directory
Hit CTRL+T to open a terminal
Type in an alias to run a command on many files

I put aliases in /etc/profile, ~.profile, I created a profile.alias in /etc. No matter what I do I cannot set a global alias. There are a couple of aliases I want to work everywhere no matter how I am logged in.

Currently, if I su to root or hit CTRL+T to open a terminal there are no aliases shown at all. Typing "alias" show absolutely nothing. If I click on the taskbar and open a terminal, there are the aliases.

This is very annoying.

Is there a way to set global aliases in Slackware 9.0
 
Old 06-15-2004, 11:31 AM   #2
LNXman
Member
 
Registered: Jul 2002
Location: California (USA)
Distribution: Slackware
Posts: 97

Rep: Reputation: 15
The way which I would set up global aliases (using your sequence as a guide) would be:

- Create a global alias file under /etc ( I would call it aliasrc )
- Within the newly created file, I would type all the aliases I want to create.
Example:
Code:
            #alias format
            #alias <alias_name>='<command>'
             alias myls='ls -al'
- Load the newly created alias file using the global profile under /etc by adding a conditional statement.
Example:
Code:
             #if statement to load global aliases
             #load the global alias if the file exists, and it is readable
              if [ -f /etc/aliasrc  -a -r /etc/aliasrc ], then
                . /etc/aliasrc
               fi
And that should do it.

However, if you are using a shell other than bash, sh, ksh, or zsh, then the process of loading global settings will be different. In the case of csh and tcsh, you will have to implement the same concept to their global settings file .login, instead of the profile.

WRT, to opening a terminal with CTR+t, check the properties of the call to the terminal in both your desktop menu, and your task bar menu, and make sure they both are being called as a login shell, and not a generic shell.

GL

P.S. if you want to load the profile when you su, you have to call it as such:
" su - " in order to load the global profile.

//edit: added wrt and p.s.

Last edited by LNXman; 06-15-2004 at 11:38 AM.
 
Old 06-15-2004, 09:52 PM   #3
mooreted
Member
 
Registered: May 2003
Posts: 598

Original Poster
Rep: Reputation: 30
Thanks. I don't know much about scripting and haven't had the time to learn. I think I'll stick with Mandrake. Everything seems to work as I would expect it to for a non-programmer.

Have a good one.

Ted.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C Global Declaration Aju Programming 3 09-29-2005 04:21 AM
where are global aliases stored? abs Slackware 5 08-27-2004 12:34 AM
kinda global aliases? pal_o_matic Linux - Newbie 1 08-01-2003 02:32 AM
Global Settings mikeshn Linux - Software 1 07-22-2003 07:42 PM
aliases set by /etc/profile not working in terminals in X Locura Slackware 8 06-26-2003 04:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration