Search Results

Search: Posts Made By: tiger2000
818
Posted By tiger2000
parsing XML result by using perl?
for some reasons, i need to parse the XML result by using perl.
for instance, this is a sample XML result:

<Response>
<status>success</status>
<answer>AAA::AAA</answer>...
1,956
Posted By tiger2000
perl - get uniq item from an array?
practicing perl now and hope to get uniq item from an array:

my current work:

#!/usr/local/bin/perl
my @source = ("aaa", "aaa", "bbb", "ccc", "ddd");

my $index=0;
my @uniq;

foreach...
6,479
Posted By tiger2000
Question about the difference between "for" and "while" loop
dear all,

i got some questions about for/while loop when working on redirect command output to for/while loop.

take one for example :

in for loop :

allfiles=`find /var/log -maxdepth 1...
3,143
Posted By tiger2000
cause lots of files on two servers need to be...
cause lots of files on two servers need to be deleted before service start....

if putting the 'find-exec-rm' command into background, then i can't control when it's finished..
3,143
Posted By tiger2000
how to delete files on two remote servers simultaneously?
dear all,

i'm preparing a script which can do these actions :

1. stop remove server's certain service
2. clean the files on remote servers simultaneously (because lots of files need to be...
10,326
Posted By tiger2000
"group by" using shell script?
not sure if it's called "group by" , but what i'm going to do is like this:

i have a file below:

192.168.1.10
192.168.1.10
192.168.1.10
192.168.1.11
192.168.1.15
192.168.1.15
192.168.1.20...
46,953
Posted By tiger2000
assign awk's variable to shell script's variable?
Dear All,

we have a command output which looks like :

Total 200 queues in 30000 Kbytes

and we're going to get "200" and "30000" for further process. currently, i'm using :

numA=echo...
1,591
Posted By tiger2000
crontab doesn't allow `command` ??
Dear All,

We wrote a script to clean email mailbox when they're nearly full and put it in cron :

0 0 * * * /root/quota/autoclean.sh > /root/quota/autoclean.`date '+%Y%m%d'` 2>&1

I've run...
4,333
Posted By tiger2000
why double brackets for array loop?
Dear All,

Recently got some sample from internet search for array handle in shell script, and I can not understand why we need to put double brackets when extracting array values by this way :
...
11,077
Posted By tiger2000
thanks so much for this easy way. by the...
thanks so much for this easy way.

by the way, if i just only have the date '%s' format, is it possible to revert it to the regular date format?

for instance : if we receive a time string like...
11,077
Posted By tiger2000
Get yesterday's date in year-month-day format?
Dear All,

Actually, i'm doing some reporting job and i need to pass yesterday's date in Year-Month-Day format(e.g. 2009-06-10) to another program for generating 2009-06-10 report.


to get...
4,218
Posted By tiger2000
grep the number of self process
Dear All,

I plan to write a script and in the beginning, I will check if there's any existing previous process running, if YEs, then exit directly, if Not, then continue.

#!/bin/bash

NUM=`ps...
1
1,192
Posted By tiger2000
awk ?
Dear All,

I have one problem in using awk to format the output. can anyone help on it?

Here's the input file :

aaa:passwd_a:s
bbb:passwd_b:s
ccc:passwd_c:t
ddd:passwd_d:s

I intend to...
11,848
Posted By tiger2000
i guess there's one missing " in 4th line? but...
i guess there's one missing " in 4th line?
but after appending the " , it still doesn't work...
11,848
Posted By tiger2000
find out duplicate records in file?
Dear All,

I have one file which looks like :

account1:passwd1
account2:passwd2
account3:passwd3
account1:passwd4
account5:passwd5
account6:passwd6

you can see there're two records for...
3,311
Posted By tiger2000
set variable in while loop?
Dear All,

Can anyone advise why this script isn't run as expected?

===========================
status=0
cat /etc/passwd |
while read line; do
status=1
done

echo $status...
Showing results 1 to 16 of 16

 

Featured Tech Videos

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