Unix/Linux Go Back    

Showing results 1 to 25 of 177
Search took 0.02 seconds.
Search: Posts Made By: msabhi
Forum: Shell Programming and Scripting Linux 01-16-2013
Replies: 3
Views: 620
Posted By msabhi
awk 'BEGIN{OFS=FS;} !/^#/ {$3=13;$5="%W";}1'...

awk 'BEGIN{OFS=FS;} !/^#/ {$3=13;$5="%W";}1' /etc/newsyslog.conf
Forum: Shell Programming and Scripting Linux 11-27-2012
Replies: 10
Views: 924
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
Forum: Shell Programming and Scripting Linux 11-27-2012
Replies: 1
Views: 2,915
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
Forum: Shell Programming and Scripting Linux 11-18-2012
Replies: 4
Views: 614
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
Forum: Shell Programming and Scripting Linux 11-18-2012
Replies: 6
Views: 1,755
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
Forum: Shell Programming and Scripting Linux 11-18-2012
Replies: 4
Views: 614
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
Forum: Shell Programming and Scripting Linux 11-18-2012
Replies: 5
Views: 2,682
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
Forum: Shell Programming and Scripting Linux 11-17-2012
Replies: 10
Views: 1,186
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
Forum: Shell Programming and Scripting Linux 11-12-2012
Replies: 4
Views: 746
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
Forum: Shell Programming and Scripting Linux 11-01-2012
Replies: 15
Views: 1,520
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...
Forum: Shell Programming and Scripting Linux 11-01-2012
Replies: 14
Views: 1,290
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..
Forum: Shell Programming and Scripting Linux 11-01-2012
Replies: 14
Views: 1,290
Posted By msabhi
Slight modification: Adding word boundary...

Slight modification: Adding word boundary...
Forum: Shell Programming and Scripting Linux 11-01-2012
Replies: 8
Views: 2,720
Posted By msabhi
perl -lne '/\s20.0\)$/g &&...

perl -lne '/\s20.0\)$/g && do{s/(\(|\)|,)//g;print;}' inputfile
Forum: Shell Programming and Scripting Linux 11-01-2012
Replies: 3
Views: 1,105
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
Forum: Shell Programming and Scripting Linux 11-01-2012
Replies: 3
Views: 1,105
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...
Forum: Shell Programming and Scripting Linux 11-01-2012
Replies: 3
Views: 771
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...
Forum: Shell Programming and Scripting Linux 10-27-2012
Replies: 16
Views: 1,941
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...
Forum: Shell Programming and Scripting Linux 10-27-2012
Replies: 16
Views: 1,941
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...
Forum: Shell Programming and Scripting Linux 10-26-2012
Replies: 5
Views: 1,297
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..
Forum: Shell Programming and Scripting Linux 10-26-2012
Replies: 5
Views: 742
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
Forum: Shell Programming and Scripting Linux 10-26-2012
Replies: 9
Views: 1,434
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
Forum: Shell Programming and Scripting Linux 10-26-2012
Replies: 9
Views: 1,434
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...
Forum: Shell Programming and Scripting Linux 10-26-2012
Replies: 5
Views: 1,297
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...
Forum: Shell Programming and Scripting Linux 10-26-2012
Replies: 3
Views: 2,070
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...
Forum: Shell Programming and Scripting Linux 10-26-2012
Replies: 2
Views: 616
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 01:39 PM.