Search Results

Search: Posts Made By: ahamed101
143,595
Posted By ahamed101
Amazing!... Yeah like vbe said, there is only...
Amazing!...
Yeah like vbe said, there is only one outcome from this... "Power of Shell Scripting!"...

I'm sure I will learn even more from this script!...
Well done mate!...

--ahamed
1,495
Posted By ahamed101
sed 's/\(if.*LOGNAME.*\)]/\1 –a $LOGNAME != su4...
sed 's/\(if.*LOGNAME.*\)]/\1 –a $LOGNAME != su4 ]/'

--ahamed
816
Posted By ahamed101
find . -type f \( -name '*.jpeg' -o -name '*.gif'...
find . -type f \( -name '*.jpeg' -o -name '*.gif' -o -name '*.bmp' -o -name '*.tiff' -o -name '*.png' \) -exec mogrify -format jpg {} \; -delete


--ahamed
2,542
Posted By ahamed101
Use -e with the echo in the above code as in echo...
Use -e with the echo in the above code as in echo -e "$output"

Or another approach

#!/bin/bash

read -p "Please enter a name : " name
awk -F":" '
BEGIN{ fmt="%20s%20s\n" }
function...
2,542
Posted By ahamed101
This is not right. Did you try the code which I...
This is not right. Did you try the code which I gave to see if it works for you without integrating it to your script?
I think what you are trying to do here is, get a input and display the details...
12,772
Posted By ahamed101
Another way... awk '{a[$2,$3]++} END {...
Another way...

awk '{a[$2,$3]++} END { printf "TP:%d\nTN:%d\nFP:%d\nFN:%d\n",a[1,1],a[0,0],a[1,0],a[0,1] }' infile


--ahamed
1,017
Posted By ahamed101
I suppose this is what you are looking for ...
I suppose this is what you are looking for

awk -F, 'BEGIN{
printf("%-20s%-20s%-20s%-20s\n", "Month", "No of files", "Total no of sucess", "Total no of failure")
}
file !=...
5,911
Posted By ahamed101
Thats right!
Thats right!
1,671
Posted By ahamed101
Try this... awk '{ ...
Try this...
awk '{
status=substr($0,91,2)
ind=substr($0,26,1);
split(substr($0, 11, 24-11), val,/\.0 /);
key[NR%2":"val[1]val[2]] = ind":"status
}
END{
...
1,671
Posted By ahamed101
I made the changes in 2 places, did you try with...
I made the changes in 2 places, did you try with the code which I posted in #6?
1,671
Posted By ahamed101
I get the output though with the input you have...
I get the output though with the input you have given.
Check if this is correct. Which is your OS?

root@maximus-netpune-21:/tmp# awk '{
> status=substr($0,91,2)
> ...
2,827
Posted By ahamed101
Exporting this makes the date/time available in...
Exporting this makes the date/time available in the history command

HISTTIMEFORMAT="%d/%m/%y %T"


Well, not sure how old this is though.
1,720
Posted By ahamed101
Try this df -h | awk '$5+0 > 45' If it...
Try this
df -h | awk '$5+0 > 45'
If it doesn't work, provide the output of df -h

And in Solaris, use nawk
Forum: Programming 03-11-2014
2,903
Posted By ahamed101
mystr is basically having the address. And when...
mystr is basically having the address. And when you do mystr = "Hello..."; you are altering the address rather than modifying the content in that address.
1,671
Posted By ahamed101
Try this awk '{ ...
Try this

awk '{
status=substr($0,91,2)
ind=substr($0,26,1);
split(substr($0, 11, 24-11), val,/\.0 /);
key[NR%2":"val[1]val[2]] = ind":"status
}
END{
...
1,314
Posted By ahamed101
Similar GNU awk approach gawk -F'##' ' {...
Similar GNU awk approach

gawk -F'##' '
{
then=mktime(substr($2,1,4)" "substr($2,5,2)" "substr($2,7,2)" "substr($2,9,2)" "substr($2,11,2)" 0")
}
now > then
' now=$(date '+%s')...
5,572
Posted By ahamed101
I have corrected the code. Its kind of...
I have corrected the code.
Its kind of difficult to code and post via mobile/tablet ;)
Forum: HP-UX 03-08-2014
4,284
Posted By ahamed101
The grep command is getting 2 values for...
The grep command is getting 2 values for tellabs7100

0 for tellabs7100
30 for tellabs7100N

and that is why the value 0^J30 is seen, ^J is actually unix line feed.

Since grep-ing for...
Forum: HP-UX 03-08-2014
4,284
Posted By ahamed101
Please correct the code tags, it is difficult to...
Please correct the code tags, it is difficult to read.
Also, paste the output of sh -x yourscript
5,572
Posted By ahamed101
awk 'NR==FNR{A[$4]=$0; next} $6 in A{ print...
awk 'NR==FNR{A[$4]=$0; next} $6 in A{ print A[$6]"\t"$0 }' file1 file2
5,873
Posted By ahamed101
You should not echo it, what i gave was an...
You should not echo it, what i gave was an example.Try this...

sshpass -p 'password' ssh -o StrictHostKeyChecking=no root@storageip 'isi_for_array -s \"isi auth ads time --sync --force\" '
...
18,902
Posted By ahamed101
Use the -exec option then find...
Use the -exec option then


find /prodoragridcn_01/app/oracle/product/10204/rdbms/audit/ -name "*.aud" -type f -mtime +60 -exec rm {} \;


--ahamed
3,015
Posted By ahamed101
Try this first to check for the right files ...
Try this first to check for the right files

find /tmp -user abcuser



And if you see the files are all correct and are the ones you want to delete, try this

find /tmp -user abcuser -exec...
991
Posted By ahamed101
Check this, illustrated with examples Bash...
Check this, illustrated with examples

Bash String (http://www.thegeekstuff.com/2010/07/bash-string-manipulation/)

HTH

--ahamed
904
Posted By ahamed101
You mean the 3rd and 4th field? Using GNU awk ...
You mean the 3rd and 4th field?
Using GNU awk


awk -F\| '
NR>1{
t1=$3; t2=$4
gsub(/[-:]/," ", t1); gsub(/[-:]/," ", t2)
if(mktime(t2) < mktime(t1))
$4=0
}1
' OFS=\|...
Showing results 1 to 25 of 475

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