.bashrc editing

9 views
Skip to first unread message

eshord

unread,
Mar 4, 2006, 10:07:40 PM3/4/06
to bash tips
hey i am using rar from rarlab.com. i'm trying to modify my .bashrc
script so that when i type "rar a [command] [-switches] archive target,
or "rar x [command] [-switches] archive target ... so that all i have
to do is say rar a or rar x and it will do the variables so i don't
have to type them in. the script kind of works, but all it is doing is
listing the 'rar' commands and switches, version, etc.

there are ideas i've come up with, neither really work. can anyone
look this over and help?

# .bashrc
# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# .rar script adding and extracting
for rar in $( a ); do
echo item: $rar a -ag+YYYY_MMDD- -ep1 -m5 -ol -ow -r -rr -s -v700m
-x*.iso -ms*.rar;*.zip;*.mp3;*.ogg;*.tar.*;*.ppt;*.PPT
fi
done
for rar in $( x ); do
echo item: $rar x -ad
fi
done

-------------------------------------------------second idea
#!/bin/bash
# .bashrc script for adding and extracting
function rar {
~/the.hole/rar/rar
}

case $(rar a) in
rar a)
-ag+YYYY_MMDD- -ep1 -m5 -ol -ow -r -rr -s -v700m -xiso
-msrar;zip;mp3;ogg;tar;ppt;PPT
;;
esac
case $(rar x) in
rar x)
-ad -ow
;;
esac

Reply all
Reply to author
Forward
0 new messages