Search Results

Search: Posts Made By: murugaperumal
27,323
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,277
Posted By murugaperumal
head -1 file | cut -c 15-18
head -1 file | cut -c 15-18
2,343
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...
8,418
Posted By murugaperumal
Now I corrected
Now I corrected
8,418
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,970
Posted By murugaperumal
sort file | sed '/^$/d' | sed -re...
sort file | sed '/^$/d' | sed -re '$s/(.*)/\1\n\n\n/'
17,186
Posted By murugaperumal
sed -r 's/(\[.*\])(.*)\]$/\1/' file
sed -r 's/(\[.*\])(.*)\]$/\1/' file
31,196
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,763
Posted By murugaperumal
find -mtime +2 -exec rm {} \;
find -mtime +2 -exec rm {} \;
19,899
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...
19,899
Posted By murugaperumal
find -mtime +28 -exec rm {} \;
find -mtime +28 -exec rm {} \;
8,519
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,645
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,645
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
3,818
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,850
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...
3,818
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
11,648
Posted By murugaperumal
cat file | cut -d'|' -f 1-4 | sed '2d' | grep...
cat file | cut -d'|' -f 1-4 | sed '2d' | grep ">"
5,979
Posted By murugaperumal
cat file| grep -Eo "\(.*\)" | sed 's/(//'|sed...
cat file| grep -Eo "\(.*\)" | sed 's/(//'|sed s'/)//'
3,337
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
22,728
Posted By murugaperumal
echo "aaaaa,bbbbb,aaaaa,ccccc,aaaaa" | sed...
echo "aaaaa,bbbbb,aaaaa,ccccc,aaaaa" | sed 's/,/\n/g' | grep -c "aaaaa"
7,293
Posted By murugaperumal
string="welcome" echo ${string:(-3)} ...
string="welcome"
echo ${string:(-3)}


The output is
ome
29,678
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,929
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,848
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

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