10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Consider the following code:
grep -o -e '^STEAM_::\d+$' workfile3.tmp
A sample format of a valid string for the regexp would be:
STEAM_0:1:12345678
Here is an example line from the workfile3.tmp file:
465:L 01/02/2012 - 00:05:33: "Spartan1-1-7<8><STEAM_0:1:47539638><>" connected
No... (2 Replies)
Discussion started by: spinner0205
2 Replies
2. Shell Programming and Scripting
Hi Experts,
I tried to stay away from posting stuff here and asking for help.
I want to print date valeu for a given variable and that is not working.
#!/bin/bash
START=`echo $1 | tr -d _`;
FV=`echo $2`
for (( c = 0 ; c < $FV ; c++ ))
do
# echo -n "`date --date="$START +$c day"... (12 Replies)
Discussion started by: PG3
12 Replies
3. Shell Programming and Scripting
I have few files in one directory as below and I require the files that were created today...
$ls -ltr
-rw-r--r-- 1 abc abc 0 Dec 5 17:34 file4.txt
-rw-r--r-- 1 abc abc 0 Dec 5 17:34 file5.txt
-rw-r--r-- 1 abc abc 0 Dec 7 17:34 file6.txt
-rw-r--r-- 1... (7 Replies)
Discussion started by: giridhar276
7 Replies
4. Shell Programming and Scripting
Hi,
I would greatly appreciate it if someone can help me with my problem.
I have a crawler which collects spam URLs everyday & this data needs to be published in a blacklist.
Here's the catch:
The "Time To Live" (TTL) for each URL is 3 months (or whatever for that matter). If i see the... (5 Replies)
Discussion started by: r4v3n
5 Replies
5. Shell Programming and Scripting
I am facing a problem while storring the grep results into a variable. I need to count the occurence of the pattern \, in a file and store that in a variable. I have given the below command
p=`grep -c '\\,' filename`
But while echoing the variable, i am getting the total number of lines in... (2 Replies)
Discussion started by: renjithv
2 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I could not find the exactly same post here.. so I will explain what I did to get the last month using date command.
I used
date +%Y-%m -d "-1 months"
to get the last month. However, the returned value of above command on 2009/10/31 was 2009 10 and not 2009 09.. and the... (9 Replies)
Discussion started by: tigersk
9 Replies
7. Shell Programming and Scripting
I have a script which will take two file as the inputs and take the Value in file1 and search in file2 and give the output in Outputfile.
#!/bin/sh
#. ${HOME}/crossworlds/bin/CWSharedEnv.sh
FILE1=$1
FILE2=$2
for Var in $(cat $FILE1);do
echo $Var
grep -i "$Var" $FILE2
done > Outputfile
I... (2 Replies)
Discussion started by: SwapnaNaidu
2 Replies
8. UNIX for Dummies Questions & Answers
egrep -A 7 -m 2 -h 'Date:|Time:' *.html
this is showing only 2 line after the context of the 2nd found match. Is this a bug in grep?
egrep -A 7 -m 2 -h 'Time:' *.html - this works correctly (2 Replies)
Discussion started by: zer0
2 Replies
9. Shell Programming and Scripting
I have a script which required the month and day as the input
ex : ./script <Month> <date>
from this I get the list of files to do further logics. The problem is when I assign these $1 and $2 to variables, and use grep command in the script
ls -l |grep "$1 $2"
it works fine for two... (1 Reply)
Discussion started by: GenMen
1 Replies
10. Shell Programming and Scripting
My goal is to find files contain the "signal 11" string in a specific directory. I need the file details followed by the string.
I wrote a script to test out and play with Shell command since it's my first time to write a Shell script.
Let me cut the story short...
this command line: if ... (2 Replies)
Discussion started by: sai0899
2 Replies