Archive for June, 2008

Three must have Aliases in Unix

These three are the must have aliases in your .bashrc file,

#alias rm=’rm -i’ — not useful while deleting directories. It will repetadly prompt for each file.

alias rm=’~/scripts/safe_rm.sh’
alias cp=’cp -i’
alias mv=’mv -i’

safe_rm.sh looks like this,

#!/usr/bin/ksh
YES=yes
CHOICE=no
FILE=$1
FORCE=”

if [[ $1 = '-rf' ]]; then
FILE=$2
FORCE=$1
fi

#if [[ -d $FILE && ! -e $FORCE ]]; then
# FORCE=’-rf’
#fi

echo “rm: remove $FILE (yes/no)?”
read CHOICE

if [[ $CHOICE = $YES ]]; then
echo “rm $FORCE $FILE”
rm $FORCE $FILE
fi

I was late in setting them and had to pay the price today.

Set them before you do an accidental delete or overwrite of important files.

Leave a Comment

Clearcase Tip : command line merge

Scenario – I did an unreserved checkout of a parent directory which is used by many people and added a new directory + files inside it. Now i need to checkin my changes.

first do -> ct lsco -d . from the parent directory.

eg:-

bash-3.00:/view/<view_name>/v_webservers$ct lshistory -d .

From the output of this command you can get the latest version of the parent directory.

Now, run merge command to merge in the changes.

bash-3.00:/view/<view_name>$ct merge -to v_webservers -version /main/ibg_webservers_7.0.0_bos/26

Leave a Comment

Clearcase Command Line Links

Clear Case command line client reference.

Config Spec explained.

Know more about  clearcase merging.

Leave a Comment