Jump to content

Recommended Posts

Posted

Здрасьте!

Есть некий BASH код:

[...]
PARAMS="P1 P2 P3"

for i in $PARAMS;
do
echo Введите $i:
read $i # чтение происходит как ожидаешь, т.е. значения получают все P1...Pn
done
[...]

А как сделать так, чтоб вывести значение Pn без непосредственного указания имени переменной, а взяв его из i, т.е. что-то типа: echo ${$i}?

Братцы, как мне организовать подстановку (или что там еще?) чтобы решить обозначенный сабж?

Заранее благодарствую,

VAVka

  • 1 month later...
Posted

я решил такую же проблему с помощью eval

$ help eval

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...