*BSD News Article 34841


Return to BSD News archive

Xref: sserve comp.unix.user-friendly:2772 comp.unix.solaris:21584 comp.unix.programmer:19470 comp.unix.misc:13611 comp.unix.aux:15114 comp.unix.bsd:14674 comp.unix.aix:42956
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!wabbit.cc.uow.edu.au!picasso.cssc-syd.tansu.com.au!wombat.cssc-syd.tansu.com.au!not-for-mail
From: chrisb@cssc-syd.tansu.com.au (Chris Bitmead)
Newsgroups: comp.unix.user-friendly,comp.unix.solaris,comp.unix.programmer,comp.unix.misc,comp.unix.aux,comp.unix.bsd,comp.unix.aix
Subject: Re: xargs and alias commands
Date: 24 Aug 1994 10:18:37 +1000
Organization: Telecom Australia - CSSC
Lines: 18
Distribution: inet
Message-ID: <33e3kt$i1i@wombat.cssc-syd.tansu.com.au>
References: <33af70$8rd@usenet.INS.CWRU.Edu> <33agia$a8t@usenet.INS.CWRU.Edu>
NNTP-Posting-Host: wombat.cssc-syd.tansu.com.au

pat@po.CWRU.Edu (Paul A. Thompson) writes:


>I have recently discovered xargs, which takes a list of files and
>runs a given command on them - very handy.  However, I would like to
>do the same with an alias that I have defined under csh - these are
>not recognized under xargs.  How can I put a csh and related source 
>command in the xargs specification?

In bash, ksh, and zsh you can put this in your start up file:
alias xargs='xargs '

The space before the quote tells the shell that xargs is a command that
executes other commands, and therefore any alias after an xargs command
will also be expanded.

I don't know how to do this in csh, but who would want to use csh anyway?