10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I am trying to create an iptables script with tail ,sed and awk.
1st Request: Search keyword "secret" in access.log file
2nd Request: Get first column matching lines (ip address)
3rd Request: Save it to a file
This is what I did so far:
grep.sh
#!/bin/bash
while true;
do
tail... (23 Replies)
Discussion started by: baris35
23 Replies
2. How to Post in the The UNIX and Linux Forums
Hi,
I want to do file format using awk script, for that i wan to use 'tail'. Here is the scenario. I will be having set of files in a directory. Those files i need to write to another directory with same file name, but while writing the file to out directory, i need to write the last line as... (3 Replies)
Discussion started by: Venkata Madhu
3 Replies
3. Shell Programming and Scripting
I have 250 files that have 16 columns each - all numbered as follows stat.1000, stat.1001, stat.1002, stat.1003....stat.1250.
I would like to join all 250 of them together tail by tail as follows. For example
stat.1000
a b c
d e f
stat.1001
g h i
j k l
So that my output... (2 Replies)
Discussion started by: kayak
2 Replies
4. Shell Programming and Scripting
Hello,
I am using a tail command to fetch the line before last in a log file.
the two last lines are as followed:
11-01-16 11:55:45.174 | CClientObject::InitTraceLevelInCache Starting
CClientObject::InitTraceLevelInCache End
I am doing a awk statement to gather only the numeric... (1 Reply)
Discussion started by: LiorAmitai
1 Replies
5. Shell Programming and Scripting
Hi everyone
i am facing a very strange problem . see below is my code
#awk <do something> file 1 > file2
Now the problem is whenever i am redirecting the output to file2 it creates the file2 but of 0 size. i don't know what is the reason but it is very important to me to redirect the... (11 Replies)
Discussion started by: aishsimplesweet
11 Replies
6. Shell Programming and Scripting
I have a system stat command running which generates data after 5 sec or so. I pass this data to awk and do some calculation to present the data differently. Once done now I want to pass this data to file as and when generated but doesn't work..unless the first command completes successfully.... (6 Replies)
Discussion started by: learnscript
6 Replies
7. Shell Programming and Scripting
I'm trying to find average of values in 2nd column in some files. Filenames have following pattern eg:
tau_2.54_even_v1.xls
tau_2.54_odd_v1.xls
tau_1.60_v1.xls
tau_800_v1.xls
#!/bin/bash
for file in pmb_mpi tau xhpl mpi_tile_io fftw ; do
for f in "2.54" "1.60" "800" ;do
if... (2 Replies)
Discussion started by: vishwamitra
2 Replies
8. UNIX for Dummies Questions & Answers
Hi ,
I have Continuous updating log file. I want to continuously scan that file using "tail -f " and execute a shell command like "date" command when that particular keyword is detected .
I am using awk to acheive it but not suceeded so far. However when I use "cat" instead of tail -f this... (3 Replies)
Discussion started by: scott_tiger
3 Replies
9. Shell Programming and Scripting
Hello,
I am too daft to remember how to properly feed numbers that I've extracted with awk(1) to tail(1).
The actual question is probably a lot more simple than the context, but let me give you the context anyway:
I've just received some email that was sent with MS Outlook and arrived in... (8 Replies)
Discussion started by: ropers
8 Replies
10. Shell Programming and Scripting
Hi,
i use awk -F to print three variable delimited by comma $1 $2 $3
if $2=="" i want to extract this information missing from another file using awk -v + some process.
but the problem i can't use the two awk together cause of redirection
there's a solution.
note: i can't use another... (1 Reply)
Discussion started by: kamel.seg
1 Replies