?
Solved

Read Command in Linux

Posted on 2006-07-13
5
Medium Priority
?
889 Views
Last Modified: 2013-12-13
How would you read a variable in a VI editor example  20, 30, 40? and execute it in Linux?
0
Comment
Question by:mayan1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 4

Expert Comment

by:yurisk
ID: 17100887
What do you mean? What are you trying to accomplish?
Variable cannot be executed - only read,written..
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17102367
vi has a scripting language, but I have only rarely used it:

http://en.wikibooks.org/wiki/Learning_the_vi_editor/Vim#Ex.2FExim_Script_language

for more information. It may be able to do what you want, but I'm sure that there are easier ways!

http://www.vim.org/htmldoc/tips.html

is part of the official vim manual

(   (()
(`-' _\
 ''  ''
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 17103653
This is a follow-on from http://www.experts-exchange.com/Programming/Programming_Platforms/Linux_Programming/Q_21916872.html right?
You don't use vi to do the read. You use vi to create a script which does the read
0
 
LVL 35

Accepted Solution

by:
Duncan Roe earned 200 total points
ID: 17103687
Ok here's an example:

#!/bin/sh
echo -n "Enter a number: "
read i
echo "You entered $i"
0
 
LVL 48

Expert Comment

by:Tintin
ID: 17104655
Do you mean run a script from vi and read the output?

If so, in vi do:

Esc:r!/path/to/script
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month13 days, left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question