Solved

Read Command in Linux

Posted on 2006-07-13
5
886 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 34

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 34

Accepted Solution

by:
Duncan Roe earned 50 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

730 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