Where "xxx" is some changing series of letters, and "123" changes so folders might look like:
etc. The numbers are what matter to me (they identify the folder), so I created an alias:
alias gal 'cd /data/me/a\!*'
So if I type gal 123* it'll bring me into the first folder.
But I'd like to have to just type in gal 123 (and not have the * there). How do I put that * into the alias?
---------- Post updated 06-19-09 at 02:22 PM ---------- Previous update was 06-18-09 at 07:44 PM ----------
That might have been too long, here's a shorter version of my question:
How do I make an alias for a command "gal" so that if I type in:
It will be interpreted as:
Last edited by Yogesh Sawant; 06-19-2009 at 10:11 AM..
Reason: added code tags
Thanks! I've never used functions before in UNIX - what would that look like?
---------- Post updated at 06:19 PM ---------- Previous update was at 04:00 PM ----------
Oh, also, I'm using CSH (putting this all in my .cshrc file).... doing some reading it seems like this doesn't support functions? So.... is there any way for me to do what I'm trying to in my .cshrc?
Thanks... so how do I pass the argument to alias in csh? I think since the argument has a * in it (!*), I can't pass an actual * immediately afterward.
I am trying to pass a second argument like so:
if ] then
export ARG2=$2
else
message "Second argument not specified: USAGE - $PROGRAM_NAME ARG1 ARG2"
checkerror -e 2 -m "Please specify if it is a history or weekly (H or W) extract in the 2nd argument"
fi
however, it always goes... (4 Replies)
Hi.
I'm trying to do a "simple" thing.
grep -rls grepped_exp path | xgs
where xgs is an alias to something like:
xargs gvim -o -c ":g/grepped_exp"
now the problem is that I want to pass the "grepped_exp" to the piped alias.
I was able to do something like what I want without the... (4 Replies)
How to pass the alphabet character as a argument in case and in if block?
ex:
c=$1
if a-z ]]
then
echo "alphabet"
case $1 in
a-z) echo "the value is a alphabet"
edit by bakunin: please use CODE-tags. We REALLY mean it. (9 Replies)
The objective of this function is to validate the file full path.
cat /dev/null > crontab_NOTEXISTS.txt
function File_Existence # Accepts 1 parameter
{
file_name="$(echo $1)"
echo "${file_name}"
&& break || echo "$file_name NOT FOUND" >> crontab_NOTEXISTS.txt
}
while read file_name... (7 Replies)
I am trying to turn this into an alias with no luck. I would then like to put the alias into my bashrc file. I know awk is very picky about quotes. I have tried every version of quotes, single quotes, double quotes, and backslashes that I can think of.
VAR=$(xrandr | awk '$2=="connected"{s=$1}... (3 Replies)
Hi all,
I have a series of directories which i open regularly. I want create an alias so that i can pass the direcotry name to alias and then this commands makes Cd to the path i need. COuld you please help on how to create an alias
ex of what i am trying but couldn't succeeded
#alias... (1 Reply)
Hi All,
i have script like below..
echo "1) first option"
echo ""
echo "2) second option"
echo ""
echo "*) please enter the correct option"
read select
case $select in
1) echo "first option selected"
;;
2) echo "second option selected"
;;
*) echo "please enter the correct... (4 Replies)
If I want to create an alias called "cdr", and this alias need an argument (for example arg1)followed by "cdr", the result should go to the directory like "/home/ting/arg1/report/logs", the command should look like below,
alias cdr arg1 "cd /home/ting/\!$1/report/logs" (not working)::(
... (1 Reply)
I want to have an alias for the command
fold -78 filename | lp
How do I set my alias so that the argument passed is filename ??
alias lp='fold -78 | lp'
then
lp filename
wont work cuase this is
fold -78 | lp filename (1 Reply)
Hi, i want make 1 alias with two commands include to do two things at the same time like this:
ex: do finger and last at the same time with only one word finla or something.
Thanks.-
/home/seba > finger dustin
Login name: dustin In real life: Dustin Feldman
Directory:... (3 Replies)