LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 04-15-2011, 10:55 AM   #1
WrapperMaven
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Rep: Reputation: 0
many tcsh aliases work in cygwin but not in fedora when defined in .alias file


Defining tcsh aliases through a .aliases file has worked perfectly for me for years and years using cygwin and older versions of mandriva. I am encountering very annoying and mysterious problems when attempting to do the same thing with a .aliases file in a fedora 64-bit VM. Strangely, if I define aliases in the file, they won't work, but if I do so on the command line, then they will.

Here's a simple example:
suppose I define an alias for "ls" in the file:
alias ls '/bin/ls'
then source the file. This happens:
me: ls
: Command not found.
me: alias ls
/bin/ls
me: /bin/ls
file1 file2 file3 etc.
me: unalias ls
me: ls
file1 file2 file3 etc.
me: alias ls '/bin/ls'
me: ls
file1 file2 file3 etc.
A second example: if I place either of these lines in my .aliases file:
alias d '/bin/ls -alF \!:1'
alias d '/bin/ls -alF \!*'
and source the alias file, this happens:
/ me: d
Bad ! arg selector.
However, if I define the alias on the command line:
/ me: alias d '/bin/ls -alF \!*'
then the alias behaves correctly:
/ me: d
total 376
drwxr-xr-x. 10 r r 4096 Apr 14 16:05 ./
drwxrwxr-x. 6 r r 4096 Feb 21 16:15 ../
drwxr-xr-x. 3 r r 4096 Apr 14 16:05 bin.v2/
-rwxr-xr-x. 1 r r 193872 Apr 14 15:35 bjam*
-rw-r--r--. 1 r r 52804 Apr 14 17:20 bjam.my.log
drwxr-xr-x. 77 r r 4096 Nov 17 09:49 boost/
-rw-r--r--. 1 r r 989 Nov 17 04:51 boost.css
A fix for this annoying but not fatal problem would be very appreciated, and an explanation of what is happening and why very much even if no fix is possible. Thanks.
 
Old 04-15-2011, 11:42 AM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
How about definig your aliases in .bashrc? EDIT: I didn't realize you weren't using bash.

Also, is your PATH set up right? It should just work when you type "ls" with no aliases.

Last edited by MTK358; 04-15-2011 at 11:45 AM.
 
Old 04-16-2011, 01:54 PM   #3
WrapperMaven
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks so much, but as you can see if you look at the 1st example, "ls" does indeed work perfectly with no alias after I "unalias" it. The paths are just fine. The example was only to show what happens when I define an alias under tcsh and then attempt to use it. Something very weird seems to happen with the aliases themselves -- in other words, it shouldn't matter whether I invoke "/bin/ls" using the alias (I should get the same result regardless, instead of the ": Command not found" message)

Thanks again for the thought --
 
  


Reply



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
Wildcard email alias in /etc/alias file custangro Linux - Enterprise 1 10-02-2009 12:17 PM
Porting alias file to from solaris to linux tcsh chrisrose21117 Linux - Newbie 2 09-27-2007 12:31 PM
tcsh script: how to see if an env var is defined? BrianK Programming 1 06-07-2004 10:12 PM
Alias commands in tcsh (Suse 9.0) m15a4 Linux - General 5 11-26-2003 03:46 PM
RH9, alias and tcsh shell jeguilloal Red Hat 1 11-26-2003 01:42 PM

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

All times are GMT -5. The time now is 05:22 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