Search Results

Search: Posts Made By: horhif
5,902
Posted By Yoda
var1=$( find /apps//log -name 'tuesday*log'...
var1=$( find /apps//log -name 'tuesday*log' -mtime +1 -exec ls -lhrt {} \; | wc -l )
if [ $var1 -eq 0 ]
then
echo "No files found"
exit
else
sleep 1
fi
1,127
Posted By Yoda
One way of doing this is using awk to extract the...
One way of doing this is using awk to extract the FS from the required line number.

Let say user selected 4 and we have the value stored in variable O
O=4
du -a /apps | sort -nr | head -n 10 |...
2,791
Posted By Don Cragun
The output from the compress utility's -v option...
The output from the compress utility's -v option is written to standard error; not to standard output. Try this minor change to elixir_sinari's suggestion:
find . -name 'filename.*.log' -mtime 14...
2,791
Posted By elixir_sinari
find . -name 'filename.*.log' -mtime 14 -exec...
find . -name 'filename.*.log' -mtime 14 -exec compress -vf {} \; > file.txt
16,823
Posted By Corona688
I don't think vi force-wraps lines like that, I...
I don't think vi force-wraps lines like that, I think the problem is happening in notepad++. Look for an option to not wrap lines...
16,823
Posted By vidyadhar85
My dear friend you cant tab out half command just...
My dear friend you cant tab out half command just to make it look cool... :cool: its like you are trying to run a command say...


$$ > da\
> te
Wed 19 Sep 15:42:01 2012
$$ > da\
> te...
16,823
Posted By vidyadhar85
I am writing scripts on Notepad++ and copying it...
I am writing scripts on Notepad++ and copying it in VI from ages and never came across the above problem not sure whats wrong going on with your system...
Forum: Solaris 09-18-2012
1,161
Posted By jim mcnamara
Try this: #!/usr/bin/bash set --...
Try this:


#!/usr/bin/bash

set -- $(ls -r test1.txt)
grep -iq 'STRING_I_NEED_TO_FIND' $1
if [ $? -eq 0 ] ; then
mailx -r server@org.com -s "Error Message found on server $HOSTNAME,...
Forum: Solaris 08-28-2012
2,304
Posted By hergp
The first line puts a list of all test*txt files...
The first line puts a list of all test*txt files in reverse order into $1, $2, ... Note: you don't have to use -l, when you want files to be sorted in reverse order.

set -- $( ls -r test*.txt)
...
5,357
Posted By vbe
As Jayan_jay suggests HOSTNAME is not initialized...
As Jayan_jay suggests HOSTNAME is not initialized or it is the one from source machine so you have to use a command: hostname then to get 2 command executed you need to use the double quotes to "make...
5,357
Posted By jayan_jay
If your HOSTNAME variable value is set in all...
If your HOSTNAME variable value is set in all servers, then you will retrieve it via ssh

$ env | grep -w HOSTNAME
HOSTNAME=xxxxxxxxx

Instead of it, go with the hostname command

ssh...
5,357
Posted By vbe
And what doesnt work?
And what doesnt work?
5,357
Posted By vbe
host is also a command so it is not wise at all...
host is also a command so it is not wise at all to use it as a variable name...
What is hostnames_here ? A file?
12,699
Posted By sam_bd
Since your data is stored in log files as...
Since your data is stored in log files as records, using 'awk' would be good option. AWK deals with column-oriented text data. Try this out.


or


Here you can print any desired column like...
12,699
Posted By Scrutinizer
Almost, you need to leave out the "|" ...
Almost, you need to leave out the "|"
<file_name cut -d " " -f 1,2
or
cut -d " " -f 1,2 < filename

To be independent of spacing it is best to use awk:
awk '{print $1,$2}' < filename
12,699
Posted By donadarsh
first put the contents of file in a temp file...
first put the contents of file in a temp file with trimming the space then try to search the pattern, words will be separated by max 1 space.


cat file_name|tr -s " " >temp_file
12,699
Posted By clx
How about.. $ mon=$(date +'%b') $...
How about..

$ mon=$(date +'%b')
$ day=$(date +'%d')
$ grep -E "$mon[ ]+$day" xx
May 23 20:34:33 server_name Process: Error_message_timed_out
May 23 20:34:33 server_name Process:...
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 11:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy