'How to use alias for opening file from its absolute path in csh

I want to create an alias, which will take file name, get its path and open it by gvim. Something like this:

alias gg "gvim `which \`"

usage:

> gg some_file_in_remote_path

But I cannot make it work in csh. Can someone help please



Solution 1:[1]

The command "which" gets a full path of of shell commands. It does not find the full path of of every file you have in your system.

The command you are looking for is "find", although searching the entire file system could be time consuming. Perhaps install "locate" and use that instead of find. Even then you would have to decide in your script what to do when multiple files have the same name.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nimrod Weinberg