Showing posts with label vi. Show all posts
Showing posts with label vi. Show all posts

Friday, June 18, 2010

Bash Command fo you

Once again, I am sharing a few good commands with you.

a) Run command in a subshell
$(cd /tmp && ls)

# You will see the contents of /tmp but will stay in PWD only.

b) Reusing cscope database
$cscope -d

c) If you default shell is csh, and you want to move to bash as soon as you login
- Create a file .cshrc in your home directory.
- Edit and add "bash"
- Save and exit.

d) vi can help you see a split screen with two or more files. Try :vsplit.

Wednesday, October 15, 2008

Rational Clearcase: Some Useful Commands

Hi,
Rational Clearcase is perhaps the most popular version management software across various organizations. Here is my humble attempt to capture most useful commands that can save a lot of your time.

a) Creating an element
$cleartool mkelem -eltype{binary, directory etc.} elem_name

b) Creating many elements at once or say you want to convert your non-clearcase element as versioned.
- first copy & paste all such files/dir in a destination directory.
$find -type f/d |xargs cleartool mkelem eltype elem_name

b) Browsing files in your branch
$ct find ./ -branch 'brtype(_view_name)' -print

c) Soft Links
$cleartool ln -s target link_name

To update a link, remove it first($ cleartool rmname link_name), create a new link with same/different in a checked-out directory.

d) Merging changes in main branch
You have two options:
1. Use cleartool merge
2. Use diff/patch OR vimdiff

cleartool merge
---------------
- Checkout file with your changes.
- $cleartool merge -to file_with_your_changes -version main_branch_version

vimdiff
-------
Amazingly simple and useful.

- Checkout file with your changes.
- $vimdiff file_with_your_changes file_on_main_branch
- You can make out the changes which are maked with different colors.
- Look the file on right side pane, a red color signifies some change in the line
- Merge changes with :,+1 diffget
- Moreover you can use any vi command.

Hope these inputs would help people.

Thanks a lot!