I need to match the string in the second column exactly so that only one result is returned, e.g.
This is no good as it returns both lines.
Works better as it only matches the exact string "backup" (excluding backup2). But I want to match only the entire string "/mnt/backup", but it appears the forward slashes affect the regex and I cannot figure out how to get them interpreted correctly. I have tried escaping them using \ but this does not work.
I have tried all sorts of other options which would just create noise in the thread and therefore are ommited...
Hi everybody,
I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o
My code:
#!/bin/sh
set -e
set -u
export IFS=
optl="Optl"
LOCSTORCLI="/opt/lsi/storcli/storcli"
($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
Hi all;
Pretty green to perl programming; been searching high and low for a perl (preferably) or unix script that will compare 2 CSV strings in the same file that are separated buy the "|" character (so basically they're side by side) and give the results of ONLY the exact change; note that 19... (3 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
I have many Gaussian output files, which contain a string start from "HF=" but follws the different values. I'm trying to get this exact string from these txt files.
example 1,
2.524075,-0.563322,-1.285286\H,0,-2.544438,-0.678834,1.199166\H,0,2.18
... (7 Replies)
hello everybody,
as explained in the title, here is what I want:
str1="name1 name2 name3"
str2="name1"
str3="name"
I know that match(str1,str2) will return 1, but I want that match(str1,str3) returns 0 (when it also returns 1...)
Is there a way to get that exact matching process done... (6 Replies)
Hi All,
Very GM
I am searching for a specific filesystem on a serevr,
like df -k "/"
i am geting an output also...
but when i am checking for somthing like /oramnt (which is not mounted currently)
so i am geting an out like this
df -k "/oramnt"
output of root...!
so i tried... (7 Replies)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
I'm trying to grep a long ls by looking at the beginning of each filename for example:
Many files begin with yong_ho_free_2005...
Many files begin with yong_ho_2005...
I can't just use "grep yong_ho" otherwise It'll display both files.
So I'm trying to use a regex but my syntax is wrong.
... (2 Replies)