LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-12-2008, 08:10 AM   #1
chrisrose21117
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Rep: Reputation: Disabled
interactive tcsh and argv


Hi all,

I have, in a .cshrc file ported from my old unix .alias file, some aliases like this;

alias oneCol 'tr " " "\012" < $1 > $2'

I'm running interactive tcsh on linux, and these aliases fail here, like this;

> oneCol test1 testOut
tcsh: $1: Ambiguous.

I believe this is because argv is not set for these interactive tcsh commands. Is there some way to force argv to be set in interactive linux (OS X) tcsh? Or what would an equivalent tcsh alias be? (Please don't tell me to use some other shell. There's got to be some way to pass command line arguments to an alias.)

Thanks -
 
Old 02-12-2008, 10:50 AM   #2
trashbird1240
Member
 
Registered: Sep 2006
Location: Durham, NC
Distribution: Slackware, Ubuntu (yes, both)
Posts: 463

Rep: Reputation: 31
Linux?

Quote:
Originally Posted by chrisrose21117 View Post
I believe this is because argv is not set for these interactive tcsh commands. Is there some way to force argv to be set in interactive linux (OS X) tcsh? Or what would an equivalent tcsh alias be? (Please don't tell me to use some other shell. There's got to be some way to pass command line arguments to an alias.)

Thanks -
So, are you using Linux or OS X?

I know that my favorite (Z Shell) has a translation utility. Are you sure you're using tcsh and not bash? Bash is the default in Linux and newer released of OS X.

Joel
 
Old 02-12-2008, 01:11 PM   #3
chrisrose21117
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am using OS X, but I'm using tcsh instead of bash as my shell.
 
Old 02-14-2008, 10:38 AM   #4
chrisrose21117
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Original Poster
Rep: Reputation: Disabled
Here's the answer

alias oneCol 'tr " " "\012" < \!:1 > \!:2'

This is not the best example as this is conceivably a command that you might want to pipe to or from, but at least here is an example of the correct syntax.
 
  


Reply

Tags
alias, argv, tcsh


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
interactive and non-interactive shell linuxjamil Programming 3 09-03-2006 08:42 PM
Question about argv[] ghoughto Programming 6 10-25-2004 09:38 AM
argv[] help wanted. (In C) vexer Programming 9 11-17-2003 05:09 AM
argc argv linuxanswer Programming 8 10-25-2003 07:54 PM
Help with argv pilot1 Programming 7 08-23-2003 02:20 PM


All times are GMT -5. The time now is 11:54 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration