Search Results

Search: Posts Made By: giri_luck
990
Posted By giri_luck
sed to add a line to a file
Hi,

I am trying to add a line to a file using sed.

tmp1:
aaaa
Hello
bbbb
Hello

I need to add "testing" after the first match of Hello. So the output should be

aaaa
Hello
testing...
4,201
Posted By giri_luck
Need to call tcl function from other file !!
Hi,

Can a function written in tcl in some other file be called in unix scripts ?
Like this ?


This is my code now---
shell.sh:
#!/bin/bash
tclsh snmpv2-conf-sam.tcl $SERVER...
1,435
Posted By giri_luck
Hi, I was trying with sed -n '/<2013...
Hi,

I was trying with

sed -n '/<2013 start/,/^<pdu.$/p'


but i do not know how to get the texts matching a word in between.
1,435
Posted By giri_luck
Texts between 2 strings
Hi,

I have a file with texts shown below,

<2013 abc
<2013 start
request pdu
dot1q
end pdu
response pdu
dot1q
end pdu


am searching for the text "dot1q" , when it matches in...
1,820
Posted By giri_luck
FTP to list files
Hi Guys,

Am writing a FTP script to download file from a remote server.

There are 3 files in the target directory.
eg.

bfg234.2
vfg345.1
abc123.1
abc123.2


I need to get the file...
2,317
Posted By giri_luck
it worked. thanks guys
it worked. thanks guys
2,317
Posted By giri_luck
<2013 abc frgv tttaaa abc123 <2013 bec...
<2013 abc frgv tttaaa
abc123
<2013 bec gggdddd
<2013 cdf sssssss
<2013 frt eeeee


Thanks for the replies. I need one more. And if at i wanted to remove all the lines which matches the word...
2,317
Posted By giri_luck
[Solved] awk to remove lines
Hi,

I have a file with contents.

file1:
<2013 tttaaa
abc123
<2013 gggdddd
<2013 sssssss
<2013 eeeee

I need to remove the lines which do not have the word "tttaaa"

can some one help ?
1,232
Posted By giri_luck
Hi Thanks, Can it be done with for each ??
Hi Thanks,

Can it be done with for each ??
1,232
Posted By giri_luck
x=(a b c) y=(d e) The code would print ...
x=(a b c)
y=(d e)

The code would print
a,d
b,e
c,d
a,e
b,d
c,e
1,232
Posted By giri_luck
Convert UNIX to perl
Hi,

Can someone convert the code into perl ?


x=(a b c)
y=(d e)
times=$((${#x } * ${#y }))
((xi=yi=0))
for((i=1;i<=times;i++,xi++,yi++))
do
if((xi>${#x }-1));then xi=0;fi
if((yi>${#y...
6
1,323
Posted By giri_luck
if i redirect the whole output goes to /dev/null...
if i redirect the whole output goes to /dev/null :-(
6
1,323
Posted By giri_luck
Everything is fine but is there a way to suppress...
Everything is fine but is there a way to suppress this part of the output ?

"Connection closed by foreign host."
1,074
Posted By giri_luck
works like a charm...can you please explain the...
works like a charm...can you please explain the script.
1,074
Posted By giri_luck
Logic for processing 2 arrays
Hi,

I need a logic for processing 2 arrays at a same time.

x=a,b,c
y=d,e

now the sequence to be followed is (a,d) , (b,e) , (c,d) , (a,e) , (b,d) , (c,e)

and again...(a,d)

The...
6
1,323
Posted By giri_luck
i tried nc commands...bad luck nc commands are...
i tried nc commands...bad luck nc commands are not supported from my server :-(

---------- Post updated at 06:23 AM ---------- Previous update was at 05:57 AM ----------

i tried this and it...
6
1,323
Posted By giri_luck
Telnet
Hi,

Need some help on exiting the telnet session from the script.

#!/bin/ksh
telnet <ip>

it would print some text and
it would ask for a username and pwd.

I jus need to capture the text...
1,860
Posted By giri_luck
SED replacement
Hi,

i have a file with lines,

file.txt
-------
test is fun
testing is better

I need to replace 'test' to 'develop' and i used,

a=test
b=develop
sed "s,$a,$b,g" -------- but i see the...
7,034
Posted By giri_luck
could you please give me the command ?
could you please give me the command ?
7,034
Posted By giri_luck
1 more question, Is it i can use a variable...
1 more question,

Is it i can use a variable here ,
awk -F"|" '$1~/$VAR/ && $2!~/:10[12]$/' file

instead of this ,

awk -F"|" '$1~/BELL-1180-1180-81/ && $2!~/:10[12]$/' file
7,034
Posted By giri_luck
Thanks it works, Could you please explain...
Thanks it works,

Could you please explain the command ?
7,034
Posted By giri_luck
grep/sed to remove lines in file
Hi,

I have a file with values,
file1:

BELL-1180-1180-81|577:1017|
BELL-1180-1180-81|jm10i-auto-stub1/577:102|
BELL-1180-1180-81|jm10i-auto-stub1/577:101|...
1,077
Posted By giri_luck
Single line
Hi,

I have a file
file1:
-----
name1=one
name2=two
name3=three

I need to print these in a single line. can you help me

like name1=one name2=two name3=three.

the delimiter can be...
1,098
Posted By giri_luck
awk command
Hi guys,

I have a file like this...

file1:
-----
dddd
Final
.....
.....
....
<pg name="path" type="Path">
....
....
....

i need to grep from "Final" to "<pg name="path"...
2,090
Posted By giri_luck
Thanks guys , it really works @ ygemici : ...
Thanks guys , it really works

@ ygemici :

Can you please explain your command ?

---------- Post updated at 03:54 AM ---------- Previous update was at 03:39 AM ----------

@ guruprasadpr :...
Showing results 1 to 25 of 53

 
All times are GMT -4. The time now is 03:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy