10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Data file example
I look for primary and * to isolate the interesting slot number.
slot=`sed '/^primary$/,/\*/!d' filename | tail -1 | sed s'/*//' | awk '{print $1" "$2}'`
Now I want to get the Touch line for only the associate slot number, in this case, because the asterisk... (2 Replies)
Discussion started by: popeye
2 Replies
2. Shell Programming and Scripting
I need to extract multiple occurance strings between 2 different patterns in given line.
For e.g. in below as input
-------------------------------------------------------------------------------------
mike(hussey) AND mike(donald) AND mike(ryan) AND mike(johnson)... (8 Replies)
Discussion started by: sameermohite
8 Replies
3. Shell Programming and Scripting
Hi all,
I have file structure as file.log
84t-rw-r--r-- 1 emily04 us_cms 24492717 Oct 5 13:29 vgtree_84_1_K3L.root
85t-rw-r--r-- 1 emily04 us_cms 50410380 Oct 5 16:06 vgtree_85_1_uZv.root
85t-rw-r--r-- 1 emily04 us_cms 50567380 Oct 5 16:06 vgtree_85_1_hjv.root
86t-rw-r--r-- 1 emily04... (4 Replies)
Discussion started by: emily
4 Replies
4. Shell Programming and Scripting
I want to replace every 2nd occurance of a string/character from a line.
ababacbsbddbsbbcbdbssb
i want to replace every s2nd b with @ like below
should be like
aba@acbs@ddbs@bc@dbss@ (3 Replies)
Discussion started by: ratheeshjulk
3 Replies
5. Shell Programming and Scripting
Hello
Im trying to grep for a string in grub.conf . I've used the -F option since its a long string, but when i execute, i run into errors. Script and output below.
GRUBPASSWD="password --md5 xyz"
if grep -Fxq $GRUBPASSWD /etc/grub.conf
then
.
.
output:
grep: unrecognized option... (5 Replies)
Discussion started by: bludhemn
5 Replies
6. Shell Programming and Scripting
hi ,
i have an xml that comes in a single, the entire xml file is read as a single line when i open in edit plus or unix. i need to amend the contents of this xml file.
below is the extract from the file
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"... (5 Replies)
Discussion started by: sais
5 Replies
7. Shell Programming and Scripting
A PERL script that prints just the first occurrence of a string in a file and immediately exits (the string and the filename are the first and the second command line arguments; I used filehandle to open an input file). (1 Reply)
Discussion started by: aadi_uni
1 Replies
8. Shell Programming and Scripting
I want to call a script like this:
./somescript some-thing.knows.what.ending
Inside the script it needs to split at last .(period)
so I can:
a=some-thing.knows.what
b=ending
I know I can do it in perl but im still learing awk and sed.
Thanks (3 Replies)
Discussion started by: Ikon
3 Replies
9. Shell Programming and Scripting
Hi
I have a file which contains the following two lines which are same But I would like to insert the value=8.8.8.8 in the 1st occurance line and value=9.9.9.9 in the 2nd occurance line.
<parameter name="TestIp1" value="">
<parameter name="TestIp1" value="">
Please suggest (1 Reply)
Discussion started by: madhusmita
1 Replies
10. Shell Programming and Scripting
Hi All,
I need to extract the last occurance of a pattern match. So far I've got the code below which extracts the first occurance. Any ideas how I can modify it so that it extracts the last?
BEGIN {}
{
if (data++ == 0)
... (17 Replies)
Discussion started by: pondlife
17 Replies