10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i am having file like this
#!/bin/bash
read -p 'Username: ' uservar
match='<color="red" />'
text='this is only a test
so please be patient
<color="red" />'
echo "$text" | sed "s/$match/&$uservar\g"
so desireble output what i want is if user type MARIA
this is only a test
so please... (13 Replies)
Discussion started by: tomislav91
13 Replies
2. Shell Programming and Scripting
Hi,
I need to collect IP address of all servers (more than 300). One way is put it in for loop and run nslookup for that servers list, but there are multiple fields in output.
(tty/dev/pts/13): bash: 1011 > nslookup vplssor04
Server: 10.58.115.34
Address: 10.58.115.34#53
Name: ... (7 Replies)
Discussion started by: solaris_1977
7 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I would like to comment a line that matched a string "sreenivas" in a file without opening it.
Thanks in advance.
Regards,
Sreenivas (3 Replies)
Discussion started by: raosr020
3 Replies
4. Shell Programming and Scripting
Hello All,
I'm working on a script that runs the wget command on a list of IP Address in order to capture the data at that address' index.html.
That part works fine to get the HTML code at that address but the data I'm trying to pull out is on a line containing a BUNCH of
code for an HTML... (4 Replies)
Discussion started by: mrm5102
4 Replies
5. Shell Programming and Scripting
Hi,
I have a file whose lines are something like
Tchampionspsq^@~^@^^^A^@^@^@^A^A^Aÿð^@^@^@^@^@^@^@^@^@^@^A^@^@^@^@^?ð^@^@^@^@^@^@^@?ð^@^@^@^@^@^@pppsq^@~^@#@^@^@^@^@^@^Hw^H^@^@^@^K^@^@^@^@xp^At^@^FTtime2psq^@ ~^@^^^A^@^@^@^B^A
I need to extract all words matching T*psq from the file.
Thing is... (4 Replies)
Discussion started by: shekhar2010us
4 Replies
6. Shell Programming and Scripting
Hi Experts,
Help needed on joining one line above & below to the pattern matched string line.
The input file, required output is mentioned below
Input file
ABCD DEFG5 42.0.1-63.38.31
KKKK iokl IP Connection Available
ABCD DEFG5 42.0.1-63.38.31
... (7 Replies)
Discussion started by: krao
7 Replies
7. Shell Programming and Scripting
Hi All,
I have two files one of which having some mobile numbers and corresponding value whose sample content as follows:
9058629605,8.0
9122828964,30.0
And in second file complete details of all mobile numbers and sample content as follows and delimeter used is comma(,):
... (8 Replies)
Discussion started by: poweroflinux
8 Replies
8. Shell Programming and Scripting
i have been doing this script to match every line in a current log file (access_log) with strings that i list from a path (consist of 100 of user's name ex: meggae )..
and then make a directory of every string from the text file (/path/meggae/) --->if it matched..
then print every line from the... (3 Replies)
Discussion started by: meggae
3 Replies
9. Shell Programming and Scripting
I would like to capture output from two commands to a test file on the same line...
I want to get a file with all Applications and the Version of it...here are the two commands I use to get the output.
To get Application list I use
ls -1 /Applications/ |grep .app >>... (3 Replies)
Discussion started by: elbombillo
3 Replies
10. UNIX for Advanced & Expert Users
All,
Is there any way out to display the nth line before the string is matched ???
Eg : If i have a file which has the following contents and if i want to get the
3rd line before the string is matched
a
b
c
d
e
f
if i give the input as f and lines before the match as 3 then it should... (5 Replies)
Discussion started by: helper
5 Replies