Unix Shell - quoting inside alias

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > January 2006 > quoting inside alias





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author quoting inside alias
Rufus T. Firefly

2006-01-29, 9:31 pm

Can't get this work right:

$ type -a function_name |sed -e 's/.*is\ a\ function$/#\ &/' >repository

should be defined as an alias with function_name and repository as
variables, ie. somthing like

type -a $* |sed -e 's/.*is\ a\ function$/#\ &/' >file$(date +_%F)

How must it be quoted for variables to be recognized inside an alias

alias fs='...'
Ed Morton

2006-01-29, 9:31 pm

Rufus T. Firefly wrote:
> Can't get this work right:
>
> $ type -a function_name |sed -e 's/.*is\ a\ function$/#\ &/' >repository
>
> should be defined as an alias with function_name and repository as
> variables, ie. somthing like
>
> type -a $* |sed -e 's/.*is\ a\ function$/#\ &/' >file$(date +_%F)
>
> How must it be quoted for variables to be recognized inside an alias
>
> alias fs='...'


I think what you're really asking is how to pass arguments to an alias
and you can't. Use a function instead.

Ed.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com