Score:0

Insert variables inside quotes

lk flag

How insert variable inside quotes in this script?

f=`sed -n '1p' < /path/ls.txt`

I try something like this but it don't work..

f=`sed -n '"$i1"p' < /path/ls.txt`
mechmati avatar
lk flag
No, i try adivce from this post and it not help me. I want incrase variable `$i` to take {1, 2, .. x} line from .txt file
muru avatar
us flag
You *didn't* try the solution from there, you tried something else. Compare your usage of quotes with that in the answer there.
mechmati avatar
lk flag
`sed -n "$i"'p' < /raid/path/ls.txt` now it work, thanks!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.