Administration
  Home arrow Administration arrow Page 5 - Vi 201
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
ADMINISTRATION

Vi 201
By: Vikram Vaswani, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2000-05-11


    Table of Contents:
  • Vi 201
  • Liar, Liar...
  • Re-thinking Relativity
  • Sweet Revenge
  • The Shell Game
  • First Aid 101
  • An Indent In Time...
  • Exit Flootburger

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Vi 201 - The Shell Game
    ( Page 5 of 8 )

    The guys who created vi built in all kinds of creature comforts designed to reduce your interaction with the shell to a minimum. One of the coolest ideas they came up with was a "shell filter", which allows you to replace shell commands with their output without needing to leave the editor at all.

    Try this - open up a blank document and type

    Today's date is date
    Now exit insert mode, position the cursor over the second "date" in that line, and type

    !!bash
    The line should now read

    Today's date is Tue May 2 15:54:13 IST 2000
    or whatever the current date and time happens to be on your system. Vi passes the word under the cursor to the interpreter specified by the user - the "bash" shell, in this case - as a command, and then replaces the word with the output of that command.

    Despite these time-saving features, there are times when you'll want to execute a shell command directly. In vi, you can do this with

    :! <shell-command>
    So, if you needed a quick directory listing of the /home directory, you could type

    :! ls -l /home
    and vi would pass the command to the shell, and display the output to you.

    Finally, vi also allows you to spawn a new shell with the

    :shell
    command. You can then execute shell commands and run other programs - even a new instance of vi, although only the truly warped among you would find this entertaining.

    Once you're done, simply log out of the spawned shell by typing

    ^-D
    and you'll be returned to your original vi session.

    This article copyright Melonfire 2000. All rights reserved.

     
     
    >>> More Administration Articles          >>> More By Vikram Vaswani, (c) Melonfire
     

       

    ADMINISTRATION ARTICLES

    - Network Booting via PXE: the Basics
    - Scalix: Linux Administrator`s Guide
    - Network Administration with FreeBSD 7
    - Components of an Information Architecture
    - The Anatomy of an Information Architecture
    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek