10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
one step in a shell script i am writing, involves Grep command to search a regular expression in a line an only print the string after the match
an example line is below
/logs/GRAS/LGT/applogs/lgt-2016-08-24/2016-08-24.8.log.zip:2016-08-24 19:12:48,602 ERROR... (9 Replies)
Discussion started by: Ramneekgupta91
9 Replies
2. Shell Programming and Scripting
Here is the content of a file:
abcdefgh
1234
When I do:
grep a?c <file>
I expect the output to show "abcdefgh". Its not happening. Any ideas?
"a?c" should mean either ac or c. This should mean the first line is a match. Yet its not happening. I have tried with -e option in grep, with... (1 Reply)
Discussion started by: Rameshck
1 Replies
3. UNIX for Advanced & Expert Users
Hello All,
I'm trying to extract the lines between two consecutive elements of an array from a file.
My array looks like:
problem_arr=(PRS111 PRS213 PRS234)
j=0
while } ]
do
k=`expr $j + 1`
sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt
---some operation goes... (11 Replies)
Discussion started by: InduInduIndu
11 Replies
4. Shell Programming and Scripting
Hello,
I am trying to use regex wtih find command in KSH. For some reason it is not working as expected.
Input:
comm_000_abc_0102.c
comm_000_abc.c
456_000_abc_1212.cpp
456_000_abc_.cpp
Expected Output:
comm_000_abc_0102.c
kkm_000_abc_8888.cpp
(Basically I want to find all... (6 Replies)
Discussion started by: vinay4889
6 Replies
5. Programming
Hi all,
How am I read a file, find the match regular expression and overwrite to the same files.
open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat";
open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat";
while (<DESTINATION_FILE>)
{
# print... (1 Reply)
Discussion started by: jessy83
1 Replies
6. Shell Programming and Scripting
Hi,
I have written a small perl script to handle particular date format using perl, but it is not substituting the whole string. Can some one please check on what is the issue with the code.
$_ = "Date: November 25, 2010 09:02:01 PM";... (1 Reply)
Discussion started by: sarbjit
1 Replies
7. Shell Programming and Scripting
CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error.
source $CA_VERSION_DATA
if * ]
then
echo "CA_RELESE $CA_RELEASE is invalid"
exit -1
fi
+ source /etc/ncgl/ca_version_data
++ CA_PRODUCT_ID=samxts
++ CA_RELEASE=6
++ CA_WEEK_NO=7
++... (3 Replies)
Discussion started by: ketkee1985
3 Replies
8. Shell Programming and Scripting
Hi,
i am java guy and new to unix.
I want to validate date pattern using Regex expression
here is the sample program i have written.
#!/bin/sh
checkDate="2010-04-09"
regex="\\d{4}-\\d{2}-\\d{2}\$"
echo $regex
if ]
then
echo "OK"
else
echo "not OK"
fi
But the ouput is... (2 Replies)
Discussion started by: vvenu88
2 Replies
9. Shell Programming and Scripting
Hi Everyone,
Mon 18 Jan 2010 09:52:10 AM MYT
the output is
20100118 09:52:10
how to do it in perl regular expression =~
Thanks (3 Replies)
Discussion started by: jimmy_y
3 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I want to find the files available in a directory /var/user/*/*/data/.
I tried using the command "find /var/user/ -path '*/*/data/ -name '*' -type f" it says find: 0652-017 -path is not a valid option and then i tried using "find /var/user/ -name '*/*/data/*' -type f" but its not... (3 Replies)
Discussion started by: vinothbabu12
3 Replies