Search Results

Search: Posts Made By: Makarand Dodmis
4,327
Posted By pilnet101
Is there any need to use awk here? Can't you just...
Is there any need to use awk here? Can't you just use grep and the mailx command alone?

---------- Post updated at 10:51 AM ---------- Previous update was at 10:46 AM ----------

How about...
2,094
Posted By Don Cragun
I see that the 1st message in this thread has...
I see that the 1st message in this thread has been modified 6 times (including twice by moderators trying to add CODE tags.

The current contents of that message give no indication of what is to be...
1,074
Posted By Don Cragun
Hi Makarand, Why use: for file in $(ls -ltr...
Hi Makarand,
Why use:
for file in $(ls -ltr *.html | awk '{ print $9 }')
instead of:
for file in *.html
The second form will not fail due to ARG_MAX limits nor filenames containing whitespace...
2,107
Posted By rbatte1
With the fairly common -d flag not being...
With the fairly common -d flag not being available for AIX, I've cobbled together this:-date
perl -e 'print scalar localtime(time - 300), "\n";'THis gives you the calculation, but the output may not...
2,219
Posted By Corona688
Ugh, that is not how you do it... Have you...
Ugh, that is not how you do it...

Have you read the link I linked? Have you read the example I showed you? They show you how.
2,176
Posted By bobochacha29
I tried all and I adjusted a little as well, but...
I tried all and I adjusted a little as well, but maybe in a wrong way :mad::mad::mad:.

Anyway, Makarand Dodmis's script worked. Thanks guys :D:D:D
2,176
Posted By Scrutinizer
server="icapp1 icapp6 ihapp1 ihapp6 icapp2 icapp3...
server="icapp1 icapp6 ihapp1 ihapp6 icapp2 icapp3 icapp4 ihapp2 ihapp3 ihapp4 icapp5 ihapp5 "
for i in $server
do
if [ "$i" = "$input" ]; then
echo hello
fi
done

case $server in
...
2,559
Posted By MadeInGermany
You need a work variable that is restored at each...
You need a work variable that is restored at each iteration

nawk '
{A[++c] = $0}
END {
for ( i = 1; i <=3; i++ ) {
x=A[c]
gsub("hello1",A[i],x)
gsub("hello2",A[i+3],x)
print x
}...
5,739
Posted By clx
You have 30 posts now. By now you should be aware...
You have 30 posts now. By now you should be aware that :

- always use code tags to post your data.
- create a new thread for new topic.


About your question, please make sure you don't have...
1,531
Posted By RudiC
That would still be vulnerable to "-" anywhere on...
That would still be vulnerable to "-" anywhere on the line.
1,531
Posted By Don Cragun
No. The grep utility searches for lines matching...
No. The grep utility searches for lines matching a regular expression, it does not change/replace text on matched lines.
Try:
sed -n 's/ -$/-n/p' filename
If it isn't obvious, the 1st part...
5,776
Posted By Yoda
awk ' { A[++c] = $1 ...
awk '
{
A[++c] = $1
}
END {
for ( i = 1; i <= c; i++ )
{
for ( j = 1; j <= c; j++ )
...
2,729
Posted By Don Cragun
The question was how long does this script take: ...
The question was how long does this script take:
#!/bin/ksh
function criteria_purge {
print "Files eligible for purging...."
ls -lt $($1) | /usr/xpg4/bin/awk -v cy=`date +%Y` '
BEGIN...
1,556
Posted By Scrutinizer
Thanks :) ... I'll try to explain: ...
Thanks :) ... I'll try to explain:
/usr/xpg4/bin/awk ' # Use the POSIX compliant version of awk on Solaris 8
$6!=month { # if the 6th field...
1,556
Posted By Scrutinizer
Try: /usr/xpg4/bin/awk '$6!=m{m=$6; c=0}...
Try:
/usr/xpg4/bin/awk '$6!=m{m=$6; c=0} {if($7!=d){if(c++>n)print b p; b=x} else b=b p ORS} {p=$0; d=$7}' n=2 file
4,432
Posted By Don Cragun
There are some very strange things going on in...
There are some very strange things going on in this thread:
Makarand Dodmis tells us that he has the following files in a directory:
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 c.txt...
2,598
Posted By SriniShoo
ls -lrt | awk '{a[(NR % 2) $6] = ($6 FS $7 FS $8...
ls -lrt | awk '{a[(NR % 2) $6] = ($6 FS $7 FS $8 FS $9)} END {for(x in a) print a[x]}'
2,598
Posted By RudiC
You would need to repeat this monthwise: ls -lt |...
You would need to repeat this monthwise: ls -lt | grep Mar | head -2
Showing results 1 to 18 of 18

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