1

Hey there,

Just a word of practical advice. If you really "need" a solution and don't have time to wait for someone else to take of their own time to help you with your problem, try doing a search on google for something like:

[QUOTE]script to remove extension from filename[/QUOTE]

and you'll have your answer straight away :)

Best wishes,

Mike

Votes + Comments
Well said
1

Hey There,

Unless it's a permissions issue (where you can't delete the folders as the user that runs the batch file) is it possible that you're trying this at the command line as proof-of-concept for the batch file.

If you're doing command line testing, although the variable MUST be %%A in your batch file, it has to be %A when run from the command line (why? I haven no idea ;)

[CODE]c:\cygwin\tmp\test>dir
Volume in drive C has no label.
Volume Serial Number is F08F-D325

Directory of c:\cygwin\tmp\test

12/16/2008 10:15 PM <DIR> .
12/16/2008 10:15 PM <DIR> ..
12/16/2008 10:15 PM <DIR> test1
0 File(s) 0 bytes
3 Dir(s) 4,743,143,424 bytes free

c:\cygwin\tmp\test>FOR /D %A IN (C:\cygwin\tmp\test*) DO rmdir /s /q %A

c:\cygwin\tmp\test>rmdir /s /q C:\cygwin\tmp\test\test1

c:\cygwin\tmp\test>dir
Volume in drive C has no label.
Volume Serial Number is F08F-D325

Directory of c:\cygwin\tmp\test

12/16/2008 10:16 PM <DIR> .
12/16/2008 10:16 PM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 4,743,143,424 bytes free

c:\cygwin\tmp\test>[/CODE]

Best wishes,

Mike

Votes + Comments
Simply awesome!
1

Hey there,

You could also just slap it all together on one line and forget about the output file. Try this and let me know if I fat-fingered any of it - this should all be one line if it gets split up:

[CODE]lsof |grep QuarkXP|awk '{ print $9,$10,$11,$12 ]'|sed 1d|xargs -ivar cp "var" ~/Desktop/Backups/.[/CODE]

depending on your version of xargs, the -i argument may be -I.

Hope that helps you out :)

Best wishes,

Mike

Votes + Comments
Let's make it count
1

Hey There,

I'm using FreeBSD 4.1 right now and got it to work by just wrapping the regular expression in quotes. It may be that your shell is interpreting the * character before it passes it to tar:

[QUOTE] # tar xvf bin.tar "perl"
perly
perltest.pl[/QUOTE]

The example above is what I used to test quickly and it failed without the quotes.

Let me know if that doesn't work. We've got some AIX boxes I can specifically try this on tomorrow. Also, if this doesn't work, try the "-L" option and put your string in a file. A bit of a pain, unless you want to match 100 unique files and don't want to type them on the command line, but will probably work, also

Best wishes,

Mike

Votes + Comments
forgetting quotes seems to have been my issue!
1

Hey There,

Bash doesn't natively support sockets programming, like in Perl. Are you looking to write a bash script that runs a separate "http server" program?

Also, if you've already gotten started, can you post that. This way anyone who checks this post will know where you're at and can help you more :)

Best wishes,

Mike

Votes + Comments
Seems like a much better idea.
1

Hey There,

You're actually pretty close on numbers. For instance, your sar -r shows:

10:07:46 freemem freeswap
10:07:47 165228 7189814
10:07:48 165228 7189814

with freemem being 165228 x pagesize (on my system 8192b/8k) :

let a=8*165228

echo $a

1321824

That's in k - so, approx 1.3gb free

and your vmstat otuput is in k, with general outputs of:

1329632

in k, by default, approx 1.3gb free.

I think you might have just gotten messed up by running vmstat 1 1 or something. The first lihe of that output is always a summary and it does show about 1.5gb free

Hope that helps. I think you're good both way :)

Let me know if I can help you out any further :)

, Mike

Votes + Comments
cheers great advice