UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 19th, 2005, 11:43 PM
runia runia is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 5 runia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 58 m 38 sec
Reputation Power: 0
vi command

Hi, I want to create an alias named vi that runs the command /usr/ucb/vi to edit text files;the alias should turn off the notification of new emails using the biff cmd before executing the vi cmd and turn biff back on after the vi cmd.
What I found on vi cmd in man is /usr/bin/vi ....[+command |-command]filename...What is this "ucb"? I came up with sth like this:
alias vi ' /usr/ucb/vi +biff n | -biff y '
vi filename
Is this anywhere close to what I need? Thanks in advance
P.S.
To guggach - THANKS.

Reply With Quote
  #2  
Old February 20th, 2005, 06:48 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 33 m 4 sec
Reputation Power: 9
ucb = University of California, Berkeley, an unix pionier (bsd)
dont use 'ucb' commands (they still are on the sys for compatibily reasons),
prefere /bin and /usr/bin

never give to aliases the name of a legal cmd
never do this
alias vi 'blah blah'
alias ls 'ls more options'
alias cd 'cd NEWDIR; ls;pwd' # a very worst one
use own names
alias myvi 'blah blah'

suppose you type (on cmd line)
cd /olddir; tar cf - . ¦( cd /newdir; tar xfvp -)
which cd will be used ? the second will probably cause a core-dump

you can concatenate cmds in alias
alias mycmd 'cmd1 ; cmd2 ; cmd3 ; and so on'

pay more attention reading man pages, that cmd in vi +cmd filename
is an editor command of vi, the notation ¦ -c cmd means
+cmd AND -c cmd are equivalent

finally, aliases can be very confusing and dangerous, because a lot
of people does not realize, they are NOT using a cmd but an alias, the
output can be essentially different ... and when piped to other cmds
__________________
working on Solaris[5-9], preferred languages french and C.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > vi command


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway