Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: ahamed101
610
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
1,818
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...
1,818
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...
717
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 !=...
3,313
Posted By ahamed101
Thats right!
Thats right!
989
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)
> ...
989
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,154
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
1,214
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.
989
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,339
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.
867
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')...
989
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{
...
2,869
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
3,067
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
3,067
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
2,869
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
3,909
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\" '
...
13,105
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
1,264
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...
697
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
1,181
Posted By ahamed101
You need to increase the decimal range #...
You need to increase the decimal range


# awk 'BEGIN{printf("%0.10f", 100 / 2649320)}'
0.0000377455


--ahamed
1,181
Posted By ahamed101
Well, I am not sure why printf behaves that way,...
Well, I am not sure why printf behaves that way, may it is not programmed to return the value but just print it out? May be it is not a function?

However, I think may be you want this?

awk...
576
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=\|...
1,549
Posted By ahamed101
Try this... awk 'p && $1 != p{print v;...
Try this...

awk 'p && $1 != p{print v; print}{p=$1;v=$0}' infile


--ahamed
Showing results 1 to 25 of 475

 

Featured Tech Videos

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