Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: murugaperumal
25,037
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.
1,985
Posted By murugaperumal
head -1 file | cut -c 15-18
head -1 file | cut -c 15-18
2,064
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,622
Posted By murugaperumal
Now I corrected
Now I corrected
7,622
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,339
Posted By murugaperumal
sort file | sed '/^$/d' | sed -re...
sort file | sed '/^$/d' | sed -re '$s/(.*)/\1\n\n\n/'
14,322
Posted By murugaperumal
sed -r 's/(\[.*\])(.*)\]$/\1/' file
sed -r 's/(\[.*\])(.*)\]$/\1/' file
27,922
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,560
Posted By murugaperumal
find -mtime +2 -exec rm {} \;
find -mtime +2 -exec rm {} \;
15,940
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...
15,940
Posted By murugaperumal
find -mtime +28 -exec rm {} \;
find -mtime +28 -exec rm {} \;
6,534
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,174
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,174
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,880
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
30,910
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,880
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,403
Posted By murugaperumal
cat file | cut -d'|' -f 1-4 | sed '2d' | grep...
cat file | cut -d'|' -f 1-4 | sed '2d' | grep ">"
5,629
Posted By murugaperumal
cat file| grep -Eo "\(.*\)" | sed 's/(//'|sed...
cat file| grep -Eo "\(.*\)" | sed 's/(//'|sed s'/)//'
2,527
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,253
Posted By murugaperumal
echo "aaaaa,bbbbb,aaaaa,ccccc,aaaaa" | sed...
echo "aaaaa,bbbbb,aaaaa,ccccc,aaaaa" | sed 's/,/\n/g' | grep -c "aaaaa"
4,235
Posted By murugaperumal
string="welcome" echo ${string:(-3)} ...
string="welcome"
echo ${string:(-3)}


The output is
ome
25,591
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,179
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,573
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 07:27 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy