10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i would like to search a variable for a pattern, without having make any calls to external tools.
i have a code like this:
COUNTPRO2="gine is very bad
vine is pretty good"
case "${COUNTPRO2}" in
*vine*)
factor=${COUNTPRO2}
echo $factor
;;
esac
If the variable contains... (7 Replies)
Discussion started by: SkySmart
7 Replies
2. Shell Programming and Scripting
Hi
I need to do a patten match between files .
I am new to shell scripting and have come up with this so far. It take 50 seconds to process files of 2mb size . I need to tune this code as file size will be around 50mb and need to save time.
Main issue is that I need to search the pattern from... (2 Replies)
Discussion started by: nitin_daharwal
2 Replies
3. Shell Programming and Scripting
Hi Gurus,
I am trying to convert some lines in a file based on the patter.Below is an example. Text after cn= and uid: should be converted to lower case.
Input:
dn: cn=XXX,ou=111,dc=222,dc=333,dc=444
uid: XXX
userPassword:: aAbVCeDr
dn: cn=XYZ,ou=111,dc=222,dc=333,dc=444
uid: XYZ... (5 Replies)
Discussion started by: Samingla
5 Replies
4. Shell Programming and Scripting
We have a configuration file in Unix. In that we have entries like below. if it ends with ":", then it is the end of record. We need to find our if there is any duplicate entries like ABCD irrespective of the case.
ABCD:\
:conn.retry.stwait=00.00.30:\
:sess.pnode.max=255:\
... (9 Replies)
Discussion started by: johnjs
9 Replies
5. Shell Programming and Scripting
Hi ,
I have the file where i have to search for the pattern. The pattern may be lower case or upper case or camel case. Basically I want to ignore while searching the pattern in awk.
awk '/error|warning/exception/' filename
Please help me (3 Replies)
Discussion started by: arukuku
3 Replies
6. Shell Programming and Scripting
HI,
My file contains data something like
034500,5,B5004946544EB185,DEFAULT,0
Now i want to do a pettern match for DEFAULT and remove that particular line from file and transfer the rest contents to temp file.But my req is i want to do case insensitive matching ie DEFAULT / default.
I... (4 Replies)
Discussion started by: centurion_13
4 Replies
7. UNIX for Dummies Questions & Answers
Using UNIX tools, but not using GAWK (NAWK is OK), is there a more elegant way to achieve this:
sed '
s/_a/_A/1
s/_b/_B/1
s/_c/_C/1
rest of alpahabet
'
I want to change the case of a single character in each string of a text file. The character will be matched by regex '_' and only... (2 Replies)
Discussion started by: uiop44
2 Replies
8. Shell Programming and Scripting
Hello Experts,
I need to create a case structure, wherein I must chk the input to match 2 values: PSDEV and PSSIT. I would like to do this using a single pattern.
I ve tried:
case
PS)
echo "here"
;;
*)
echo "there"
;;
esac
Idk exactly how... (5 Replies)
Discussion started by: hkansal
5 Replies
9. Shell Programming and Scripting
I have a file abc.sh which looks like
qacc1 ----> down
v5c0
check interface v5c1
I want to read this file line by line and perform a certain action if a particular pattern is found in that line. My code so far looks like this:
FileName='abc.sh'
while read LINE
do
echo $LINE
case... (2 Replies)
Discussion started by: lassimanji
2 Replies
10. Shell Programming and Scripting
I am using ksh on a HP Ux. I have a simple script but am having problem with the case statement:-
#!/usr/bin/sh
Chl=”SM.APPLE_SWIFT_DV”
LoConfirm=””
case $chl in
)
LoConfirm=”Using channel at Building 1”
echo “test conditon1”
echo $LoConfirm;;
)
LoConfirm=”Using... (2 Replies)
Discussion started by: gummysweets
2 Replies