Hi,
I want to substitute variable in sed using combination of name and var_$name:
name=Tom
var_$name=1
sed -n "${var_"$name"}"p < myfile
but it doesn't work, do you know what's wrong ?
Thanks (1 Reply)
Hi
I have a variable whose value is like this
i=/test/test1/test2/myfile.cd.070505123457
i would like to have the value of myfile.cd stored into another variable
my attempt is
test=${i##*/} ;echo $test ##and i get
myfile.cd.070505123457
since what i wnat is myfile.cd i try this... (19 Replies)
In a file I want to globally change a "|" charater by a new line character.
I am using the command
1,$s/\|/??/g
Can anybody say what should I put in place of ?? in the above command? (3 Replies)
This is the code and I'm wondering why line 14: a = ... and line 16: b = ... is wrong.
This is the first time I've tried to use this. Please help me.
#include <stdio.h>
#include <math.h>
// The link and how the double pow is used.
//
// http://www.nextdawn.nl/c-reference/pow.php
//... (2 Replies)
Hi,
What is the actual difference between these two? Why the following code works for process substitution and fails for command substitution?
while IFS= read -r line; do echo $line; done < <(cat file)executes successfully and display the contents of the file
But,
while IFS='\n' read -r... (3 Replies)
Hi,
I am generating html code using cshell, but i am having one problem while printing double quotes,
I need to write following code in file. where $var contains list of web address
<a href="$var">$var</a>
So i am using
echo "<a href="$var">$var</a>" > file.html
But with this " in... (4 Replies)
Hi,
I have data as
"01/22/97-"aaaaaaaaaaaaaaaaa""aaa""aabbbbbbbbcccccc""zbcd""dddddddddeeeeeeeeefffffff"
I want to remove only the Consequitive double quotes and not the one which occurs single.
My O/P must be ... (2 Replies)
Hi Froum.
I have tried in vain to find a solution for this problem - I'm trying to replace any double quotes within a quoted string with a single quote, leaving everything else as is.
I have the following data:
Before:
... (32 Replies)