Search Results

Search: Posts Made By: murugaperumal
25,445
Posted By murugaperumal
while read line do echo $line done <...
while read line
do
echo $line
done < file


The above code for getting the content line by line.
2,044
Posted By murugaperumal
head -1 file | cut -c 15-18
head -1 file | cut -c 15-18
2,122
Posted By murugaperumal
for file in `ls dir` do echo $file ...
for file in `ls dir`
do
echo $file
var=`head -1 dir/$file |cut -c 10-19 | sed -r 's/([0-9]{2})([0-9]+$)/\2.\1'/`
echo $var;
`mv A/$file dir/$var`
done


Here dir is the...
7,837
Posted By murugaperumal
Now I corrected
Now I corrected
7,837
Posted By murugaperumal
NO_OF_LOOPS=$1 for i in `seq 0 $NO_OF_LOOPS`
NO_OF_LOOPS=$1
for i in `seq 0 $NO_OF_LOOPS`
2,444
Posted By murugaperumal
sort file | sed '/^$/d' | sed -re...
sort file | sed '/^$/d' | sed -re '$s/(.*)/\1\n\n\n/'
15,192
Posted By murugaperumal
sed -r 's/(\[.*\])(.*)\]$/\1/' file
sed -r 's/(\[.*\])(.*)\]$/\1/' file
28,582
Posted By murugaperumal
Refer the following link The AWK Manual -...
Refer the following link

The AWK Manual - Printf Examples (http://people.cs.uu.nl/piet/docs/nawk/nawk_36.html)
2,597
Posted By murugaperumal
find -mtime +2 -exec rm {} \;
find -mtime +2 -exec rm {} \;
16,657
Posted By murugaperumal
DON'T YOU KNOW THAT IS THE ACTUAL REQUIREMENT. ...
DON'T YOU KNOW THAT IS THE ACTUAL REQUIREMENT.
READ THE FOLLOWING LINE OF THE POSTER's POST.
Ex : - If today is 28th Mar 2010 then I have to delete the files which arrived on 1st Mar 2010,

FOR...
16,657
Posted By murugaperumal
find -mtime +28 -exec rm {} \;
find -mtime +28 -exec rm {} \;
7,006
Posted By murugaperumal
Using chmod command you can achieve this. ...
Using chmod command you can achieve this.


for i in $@
do
if [ -d $i ]
then
`chmod 000 $i`;
else
echo "$i not a directory"
...
Forum: Linux 03-18-2010
3,281
Posted By murugaperumal
This code not give the created file. It will give...
This code not give the created file. It will give the modified file only.

---------- Post updated at 12:07 PM ---------- Previous update was at 12:05 PM ----------




You can't get the file...
Forum: Linux 03-18-2010
3,281
Posted By murugaperumal
This code not give the created file. It will give...
This code not give the created file. It will give only the modified file only
2,959
Posted By murugaperumal
Try the following code sed...
Try the following code


sed '1,$N;s/\n//g' file | sed -r 's/\[[a-z]+=([0-9]+)\]\[[a-z]+=([a-z]+)\].*\[[a-z]+=([a-z]+)\]\[[a-z]+=([0-9]+)\]/\1,\4,\2,\3/' | sort
31,175
Posted By murugaperumal
You did some mistake in your code. Because in...
You did some mistake in your code. Because in the regular expression you are not match correctly. The following code will give the correct answer

cat filename | sed 's/.*http\://g'


or...
2,959
Posted By murugaperumal
sed -r...
sed -r 's/\[[a-z]+=([0-9]+)\]\[[a-z]+=([a-z]+)\].*\[[a-z]+=([a-z]+)\]/\1,\2,\3/' filename | sort
10,848
Posted By murugaperumal
cat file | cut -d'|' -f 1-4 | sed '2d' | grep...
cat file | cut -d'|' -f 1-4 | sed '2d' | grep ">"
5,710
Posted By murugaperumal
cat file| grep -Eo "\(.*\)" | sed 's/(//'|sed...
cat file| grep -Eo "\(.*\)" | sed 's/(//'|sed s'/)//'
2,661
Posted By murugaperumal
#!/bin/bash i=1; while read line; do sed...
#!/bin/bash
i=1;
while read line;
do
sed -n ${i}p config.txt
i=`expr $i + 1`;
done < "config.txt"


This code will work for any no of lines
21,547
Posted By murugaperumal
echo "aaaaa,bbbbb,aaaaa,ccccc,aaaaa" | sed...
echo "aaaaa,bbbbb,aaaaa,ccccc,aaaaa" | sed 's/,/\n/g' | grep -c "aaaaa"
4,279
Posted By murugaperumal
string="welcome" echo ${string:(-3)} ...
string="welcome"
echo ${string:(-3)}


The output is
ome
26,179
Posted By murugaperumal
In the first question you need to write the...
In the first question you need to write the following script

#!/bin/sh

for i in `seq 1 10`;
do
echo $i
done


In the second code is working correctly in my system.
5,312
Posted By murugaperumal
use strict; use warnings; use Data::Dumper; ...
use strict;
use warnings;
use Data::Dumper;
open FH, "<new" or die "Can't Open $!";
my @array1;
my %hash;
<FH>;
while(<FH>)
{
my @array=split(' ',$_);
push(@array1,$array[4]);
}...
1,621
Posted By murugaperumal
use strict; use warnings; use Data::Dumper; ...
use strict;
use warnings;
use Data::Dumper;
my $var1=shift;
my $var;
if( -d $var1)
{
opendir(DIR,$var1);
my @array=readdir(DIR);
foreach(@array)
{
$var=$var1."/".$_;
...
Showing results 1 to 25 of 90

 

Featured Tech Videos

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