Can PowerShell do this?

N

no.top.post

In 199x when my ISP said that the Win3.1 which I'd bought
was no longer good enough and I'd have to buy W95, I said
screw-you and switched to linux.

Now I [thought I] had to buy a Win7netbook to connect to a
wireless-modem, and I see it's got 'power shell' which might be
interesting to experiment with. I'm investigating concatenative
style.

Can PS do jobs like:
1. list all files in dir-tree D
2 which are less than 23 days old
3. which contain string1
4. and string2
5. and string3 ??

The nice thing about concatenative [5 stages], is that you
can develop and test each stage independantly.

Linux finds that important file which I read & saved after
I got back from vac.,
which mentioned "oeing" and "efault" and "udjment"
by: `FindDays3Strings 23 oeing efault udjment`
which calls the follwing `FindDays3Strings` script:
find . -type f -ctime -$1 -print0 | \
xargs -0 grep -l $2 | tr "\n" "\0" | \
xargs -0 grep -l $3 | tr "\n" "\0" | \
xargs -0 grep -l $4

or a simpler one: find files < 7 days-old containing "key-word":

find ./ -ctime -7 -exec grep -l "key-word" {} \;

From what I read about 'foreach' it seems that PS can handle the
concatenative style?

== TIA.
 
C

Char Jackson

In 199x when my ISP said that the Win3.1 which I'd bought
was no longer good enough and I'd have to buy W95, I said
screw-you and switched to linux.
Huh? Why would you seek that kind of advice from an Internet Service
Provider? They don't care which OS you use. As long as you pay your
bill every month, they're happy.
Now I [thought I] had to buy a Win7netbook to connect to a
wireless-modem,
If by 'wireless-modem' you mean something capable of 802.11 (a/b/g/n)
then no, Win 7 isn't required. Any Windows, MAC, or Linux OS should be
fine.
 
P

Peter Foldes

In 199x when my ISP said that the Win3.1 which I'd bought
was no longer good enough and I'd have to buy W95, I said
screw-you and switched to linux.

Now I [thought I] had to buy a Win7netbook to connect to a
wireless-modem, and I see it's got 'power shell' which might be
interesting to experiment with. I'm investigating concatenative
style.

Can PS do jobs like:
1. list all files in dir-tree D
2 which are less than 23 days old
3. which contain string1
4. and string2
5. and string3 ??


All that you need to know about PowerShell

http://en.wikipedia.org/wiki/Windows_PowerShell

JS
 
D

DanS

(e-mail address removed) wrote in
In 199x when my ISP said that the Win3.1 which I'd bought
was no longer good enough and I'd have to buy W95, I said
screw-you and switched to linux.

Now I [thought I] had to buy a Win7netbook to connect to a
wireless-modem, and I see it's got 'power shell' which
might be interesting to experiment with. I'm investigating
concatenative style.

Can PS do jobs like:
1. list all files in dir-tree D
2 which are less than 23 days old
3. which contain string1
4. and string2
5. and string3 ??

The nice thing about concatenative [5 stages], is that you
can develop and test each stage independantly.

Linux finds that important file which I read & saved after
I got back from vac.,
which mentioned "oeing" and "efault" and "udjment"
by: `FindDays3Strings 23 oeing efault udjment`
which calls the follwing `FindDays3Strings` script:
find . -type f -ctime -$1 -print0 | \
xargs -0 grep -l $2 | tr "\n" "\0" | \
xargs -0 grep -l $3 | tr "\n" "\0" | \
xargs -0 grep -l $4

or a simpler one: find files < 7 days-old containing
"key-word":

find ./ -ctime -7 -exec grep -l "key-word" {} \;

From what I read about 'foreach' it seems that PS can
handle the concatenative style?

== TIA.
I find (the free) WinGrep works well, but only as a GUI
app.....(Always set to NOT count files first.)


http://www.wingrep.com/
 
S

Steven L.

In 199x when my ISP said that the Win3.1 which I'd bought
was no longer good enough and I'd have to buy W95, I said
screw-you and switched to linux.

Now I [thought I] had to buy a Win7netbook to connect to a
wireless-modem, and I see it's got 'power shell' which might be
interesting to experiment with. I'm investigating concatenative
style.

Can PS do jobs like:
1. list all files in dir-tree D
2 which are less than 23 days old
3. which contain string1
4. and string2
5. and string3 ??

The nice thing about concatenative [5 stages], is that you
can develop and test each stage independantly.

Linux finds that important file which I read & saved after
I got back from vac.,
which mentioned "oeing" and "efault" and "udjment"
by: `FindDays3Strings 23 oeing efault udjment`
which calls the follwing `FindDays3Strings` script:
find . -type f -ctime -$1 -print0 | \
xargs -0 grep -l $2 | tr "\n" "\0" | \
xargs -0 grep -l $3 | tr "\n" "\0" | \
xargs -0 grep -l $4

or a simpler one: find files < 7 days-old containing "key-word":

find ./ -ctime -7 -exec grep -l "key-word" {} \;

From what I read about 'foreach' it seems that PS can handle the
concatenative style?

== TIA.
If you like Unix shell scripting,
then get Cygwin for Windows. Cygwin gives you a Bash shell workalike
with the usual Linux utilities like grep.

http://www.cygwin.com/


So the script you wrote there ought to work.



-- Steven L.
 
B

BillW50

In
Char said:
Huh? Why would you seek that kind of advice from an Internet Service
Provider? They don't care which OS you use. As long as you pay your
bill every month, they're happy.
I had a tiny ISP from a Linux guy (back in the 90's) who ran it out of
his home. It was about half of the price of most other ISPs. Although he
called me one day (on the dialup line no less). And told me to quit
using Windows. As he complained that my Microsoft software would crash
his Linux servers. :p
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top