Amit Agarwal

Linux and Photography Blog
address
mail

I was working on a project, where I need to open file from different servers and different paths. I do it with the command:

vim ftp://username@server/path/filename

This is okay when the path is short but when the path gets longer and I have different config files to open from the same path or their associated logs, then it becomes un-necessary typing. So, I did the following:

Have a file with some aliase’s like the below and source it from the bashrc file:

conf_app1=dns #this is with path

conf_app2=host

log_app1=dns #this too is with path

log_app2=hosts

And then I have a bash script that will use these variables to open the file required. I use the format as

view.sh c/l app1

where c/l denotes whether I want to open the config file or the log file. Download the script here.

Enter Your Mail Address

Bash script to view log and config file in different server and paths. Bash script to view log and config file in different server and paths.

Facebook comments:

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment



IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)

What is 12 + 10 ?
Please leave these two fields as-is:
notice

© 2010 Amit Agarwal | Entries (RSS) and Comments (RSS) | Valid CSS 2.1 Valid XHTML 1.0 Transitional

Powered by Wordpress 3.0.1, design by Abel, handcrafted by Abel County Laboratories, based on Wsg Standards Wsg Standards

Switch to our mobile site

Page optimized by WP Minify WordPress Plugin