Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: lathavim
1,712
Posted By lathavim
if [ -s $filename2 ] then rm $filename2 ...
if [ -s $filename2 ]
then
rm $filename2
else
rm $filename $filename2
fi
1,493
Posted By lathavim
Try this... #!/bin/ksh if [ "$1" =...
Try this...


#!/bin/ksh
if [ "$1" = "" ];
then ## No parameters were entered
echo "Enter the fully qualified file name:"
read mInputValue
echo "The value is `eval echo $mInputValue`"...
1,266
Posted By lathavim
egrep "$today*.*Port search...
egrep "$today*.*Port search parameters|$today*.*processed" file
4,584
Posted By lathavim
sed -e '1d' -e '/@executable_path/d' -e...
sed -e '1d' -e '/@executable_path/d' -e 's/(.*)$//' -e 's/\/Versions.*$//' file
1,493
Posted By lathavim
what value you are assinging to str2? ...
what value you are assinging to str2?



str2=$str or str2=$str1
2,420
Posted By lathavim
while read record do a=`echo $record | cut...
while read record
do
a=`echo $record | cut -c11-20`
echo $a | grep 1 1>/dev/null
if [ $? -eq 0 ]
then
echo $record >>output
fi
done<input

---------- Post updated at 05:35 AM ----------...
2,420
Posted By lathavim
Hi, For the 6th record, I don't see 1 inbetween...
Hi, For the 6th record, I don't see 1 inbetween 11th & 20th position. Only for the 2nd & 4th records i can see your condition matching. Please could you explain why 6th record has to be present in...
15,537
Posted By lathavim
var=`cat file`
var=`cat file`
4,584
Posted By lathavim
See if this works. sed -e '1d'...
See if this works.




sed -e '1d' -e '/@executable_path/d' filename | cut -d " " -f1
3,608
Posted By lathavim
How about this? sed -n '/ravi...
How about this?



sed -n '/ravi kumar/,/*/p' file
4,023
Posted By lathavim
Try this. sed '/pattern/{N;d;}'...
Try this.



sed '/pattern/{N;d;}' file
3,749
Posted By lathavim
sort -t"," -k1.1,1.4 -k2.7,2.10 -k2.4,2.5...
sort -t"," -k1.1,1.4 -k2.7,2.10 -k2.4,2.5 -k2.1,2.2 file

or


sort -t"," -k1,1n -k2.7,2.10 -k2.4,2.5 -k2.1,2.2 file
2,790
Posted By lathavim
echo $word | sed "s/o/$in1/1" This replaces...
echo $word | sed "s/o/$in1/1"

This replaces first occurance of the char 'O'
2,853
Posted By lathavim
What is $a here? I am bit confused with your...
What is $a here? I am bit confused with your requirement.

If you just want to read and append a line to the end of a file, then try this.


echo "Enter the URL that should point to the...
2,644
Posted By lathavim
for file in `ls folderb` do find foldera...
for file in `ls folderb`
do
find foldera -type f -name "$file" -exec rm -f {} \;
done
1,528
Posted By lathavim
while read record do a=`grep $record file2` ...
while read record
do
a=`grep $record file2`
if [ "$a" == "" ]
then
echo $record >>newfile
fi
done<file1
1,683
Posted By lathavim
Try this. var=`date +"%d%m%Y"` ...
Try this.


var=`date +"%d%m%Y"`

awk '/^HEADER/{close("file"f);f++}{print $0 > '$var'"_FILE_"f}' $Filename
1,497
Posted By lathavim
sed -n '/unknown/{N;N;N;p;}' file
sed -n '/unknown/{N;N;N;p;}' file
15,596
Posted By lathavim
You can try with loop. ls *rft |...
You can try with loop.



ls *rft | head -20 >tmp
while read file
do
cp "$file" ./chk
done<tmp
2,247
Posted By lathavim
Hi, This should work for ksh. ...
Hi, This should work for ksh.


#!/bin/ksh
grep -E 'username1|username4' filename >output


What shell are you using?
2,247
Posted By lathavim
grep -E 'username1|username4' filename
grep -E 'username1|username4' filename
2,247
Posted By lathavim
grep username1 inputfile >>outputfile ...
grep username1 inputfile >>outputfile


Incase if you want to do the search with backslash.

grep username1\\\\ inputfile >>outputfile
4,980
Posted By lathavim
How about this? var="hi how are you" ...
How about this?


var="hi how are you"
echo $var | wc -w
30,047
Posted By lathavim
See if this works. awk '{ if (NR % 3) ...
See if this works.

awk '{
if (NR % 3)
printf("%s ", $0)
else
printf("%s\n", $0)
}' file
2,493
Posted By lathavim
Are you sure that you used accent mark (`) for...
Are you sure that you used accent mark (`) for the ls command? I am wondering whether you have used single quotes.



myfile=`lsMyfile*`


---------- Post updated at 04:38 AM ----------...
Showing results 1 to 25 of 70

 

Featured Tech Videos

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