Search Results

Search: Posts Made By: msabhi
1,042
Posted By msabhi
awk 'BEGIN{OFS=FS;} !/^#/ {$3=13;$5="%W";}1'...
awk 'BEGIN{OFS=FS;} !/^#/ {$3=13;$5="%W";}1' /etc/newsyslog.conf
1,608
Posted By msabhi
1>Use Code tags 2>The command is correctly...
1>Use Code tags
2>The command is correctly giving in the way its designed
3>Unless you don't mention your output data, helping is very difficult
4,112
Posted By msabhi
awk -F";" 'NR==FNR{x[$0]++;next;}...
awk -F";" 'NR==FNR{x[$0]++;next;} {if(x[$1]){print $0" HIT";} else print;}' file1 file2
1,109
Posted By msabhi
find . -name "*" -type f -atime -1 -a -mtime +1...
find . -name "*" -type f -atime -1 -a -mtime +1 -exec stat -c "<{}> <%x> <%y>" {} \;



Accessed in last 24 hours but not modified in last 24 hours
2,642
Posted By msabhi
@Kar_333 Your request incomprehensible...Do you...
@Kar_333
Your request incomprehensible...Do you understand "trailing whitespaces"? Please use code tags and place your request again
1,109
Posted By msabhi
find . -name "*" -type f -mtime -1 -exec stat -c...
find . -name "*" -type f -mtime -1 -exec stat -c "{} %x %y" {} \;



---------- Post updated at 01:17 PM ---------- Previous update was at 01:15 PM ----------

And if you want those angles

...
5,818
Posted By msabhi
How about sed? var='select_id="x_0' ...
How about sed?


var='select_id="x_0' #you need not escape " when using single quote
sed "/$var/,/from/" x.txt
2,454
Posted By msabhi
Can you try this? This shall work in any worst...
Can you try this? This shall work in any worst case too..

perl -alne '{if($#F>0){@a=@F[1..$#F];} print "$F[0] @a";}' input
1,545
Posted By msabhi
if every tpeserver contains only 3 lines after...
if every tpeserver contains only 3 lines after it, then you can go for thissed -n "/id=${id}/ {N;N;N;p}" input_file
2,402
Posted By msabhi
Added to this, whats the delimiter of the file...
Added to this, whats the delimiter of the file and whether the coulmns are sorted etc.
Simple solution is to provide us your sample data in both files...
2,523
Posted By msabhi
In addition to uuencode there's also sendmail...
In addition to uuencode there's also sendmail command which is quite flexible and customized command..
2,523
Posted By msabhi
Slight modification: Adding word boundary...
Slight modification: Adding word boundary...
9,068
Posted By msabhi
perl -lne '/\s20.0\)$/g &&...
perl -lne '/\s20.0\)$/g && do{s/(\(|\)|,)//g;print;}' inputfile
1,653
Posted By msabhi
Ok, if you want to display those in file1 and not...
Ok, if you want to display those in file1 and not in file2 follow the below steps

1>sort both the files using the sort command
2>using comm command on sorted filescomm -2 -3 file1 file2
1,653
Posted By msabhi
1>Try searching in the forum for this frequently...
1>Try searching in the forum for this frequently asked question
2>If not, display your sample file so that a best solution can be provided. If its just a single column of servers, first sort both...
1,005
Posted By msabhi
perl -lne 'BEGIN{@id=split(/,/,"SL,SN, TB, pad...
perl -lne 'BEGIN{@id=split(/,/,"SL,SN, TB, pad up, pad down, time up to down, time down to pressure switch, time down to ready, time down to sweep");}
{for $id...
6,471
Posted By msabhi
-t "." this option stands for identifying...
-t "." this option stands for identifying delimiter and here its dot
-k3.1,3.4n "k start,stop" stands for field to start and stop at...first am sorting on years which happens to be 3rd column..so...
6,471
Posted By msabhi
sort -t"." -k3.1,3.4n -k2,2n -k1,1n temp But...
sort -t"." -k3.1,3.4n -k2,2n -k1,1n temp
But this sorts for only years,months,days..let me know if you want to dig into time also..

And yeah, Spacebar's code is working great for even time..you...
2,770
Posted By msabhi
You can change the text highlighted in red to...
You can change the text highlighted in red to your customized occurrence...
I hope i got your requirement right..
1,334
Posted By msabhi
And if you want to save the changes onto the file...
And if you want to save the changes onto the file then use -i option
3,822
Posted By msabhi
Can you try this /usr/bin/stat -c "%W"...
Can you try this
/usr/bin/stat -c "%W" wpar_monitor_2days.log
If this doesn't work, i guess stat is not available on your system...you can check the availability using which stat
3,822
Posted By msabhi
I shall only guide you on one way of achieving...
I shall only guide you on one way of achieving the same..you can use this logic if you find it better than ones given by others here...

1>You can get the epoch seconds of the time of creation of...
2,770
Posted By msabhi
For files 1>First check with the below command...
For files
1>First check with the below command if you are satisfied with the results

ls * | perl -lne '{$Tget=$_;s/\./ -- ttgductoog ggdté gollogtd./;print "$Tget"." <--TO--> "."$_";}'


2>If...
7,459
Posted By msabhi
if [ $CNT -gt 0 ]; then test conditions' square...
if [ $CNT -gt 0 ]; then test conditions' square brackets should be spaced properly like above...
1,024
Posted By msabhi
perl -F'\|' -MTime::Local -alne...
perl -F'\|' -MTime::Local -alne 'BEGIN{$ten=(timelocal((localtime)[0..5])-600)}{print if $F[$#F]>=$ten;}' input_file
Showing results 1 to 25 of 177

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