Why is there no built-in grep in Windows? [closed] - windows

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
In e.g. the question Is there a Pattern Matching Utility like GREP in Windows?, one can find a few options for adding a grep utility to windows. But I am wondering why it's the case that there is no built-in grep-like function in Windows, as this seems to be a supremely useful thing (at least to a Linux user).
More specifically, is there a technical reason for this? E.g. does the difference in OS/filesystem architecture between Windows and Linux make it more difficult/slow/pointless/unsafe/etc. to have such functionality in Windows?
(I can imagine for example that an antivirus might not like for a program to read thousands of files in one go, and because of that microsoft perhaps decided to scrap a grep utility. That's of course pure speculation on my behalf, but it's the kind of answer I'm looking for)

"Grep" is an unix tool - it was originally made for unix.
As far as the functionality goes, we have built-in "grep". Windows offers something similiar through commands find and findstr, which do quite a lot, and have been available for long time.
Plus, you can search file content through windows search.

Related

What is the language of choice for shell scripting under a generic Windows installation? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What is the equivalent of the POSIX compliant sh shell language or bash extensions in the Windows world ?
What is the optimal choice when writing a script that is supposed to run on as many different versions of Windows as possible ?
I need a solution that is supposed to be already present/installed on the client side, so I tend to exclude the only scripting solution that I know of, Powershell, and I'm considering Windows XP as the oldest target.
I know you do not want to read this: If you need a solution to be present on the client side from XP to 8.1 try to do your scripts with Windows cmd.exe.

What is the code within the choice command [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
That title may be a bit confusing, so let me elaborate. I want to know what the code is behind the choice command. There is not really much reason other than curiosity and the fact that it might help me one day. I've searched everywhere but can't find it.
I don't know much about open source projects and the like, but may it be because Windows doesn't want people to know (or for it to be easily accessible)?
Any information will be appreciated.
Windows is not open source. The code for any Windows command-line utilities is not routinely released. This has nothing to do with Microsoft especially not wanting you to know how choice in particular is implemented!
That said, it looks to be very straight-forward. Implementation would be a dozen lines or so at most.. what part of it is giving you trouble?
As Mahmoud Al-Qudsi pointed out, Windows is not open source. FreeDOS however is, and the choice command is available here.

Handling files in Windows like on the Mac [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
It can this is a silly question, but is it possible to handle files on Windows (XP, Vista or 7) like on the Mac?
I clarify: on the Mac you can rename or move a file even if it is currently used by an application, on Windows you simply cannot! There is a way to change this behavior with some black magic on the Registry?
If you are interested You can read about File locking and specific implementations in Windows and Mac here
http://en.wikipedia.org/wiki/File_locking
I use unlocker to get around this problem in Windows. It's quite handy
http://www.emptyloop.com/unlocker/
No, there is no builtin solution to your problem and I haven't heard of any tool accomplishing that.
It's not possible because the file handling is done in a different way, which is also strongly influenced by the features of the different filesystems.

Windows shell/command prompt? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
On the Windows operating system, the shell/terminal we have by default is the Command Prompt (CMD).
Now, when I use Linux (or even Mac) systems, I find that the terminal is generally a lot more full featured. The one I used made it easy to change settings and properties, was easily resizable, some even had line numbering and multiple tabs.
Since I've started programming, I've realized the importance of the command line, and I was wondering if there were any alternatives to the default Command Prompt? And, if there aren't many good alternatives, how would I go about writing my own? What would I have to take into consideration?
Yes, the Windows command prompt sucks. It is truly pathetic for 2011.
I use Cygwin+mintty instead.
If you miss Tilda/Guake/Yakuake (for Linux) or TotalTerminal (née Visor) (for OS X) try mintty-quake-console.
Edit
Just came across another potential alternative, though I haven't tried it out yet: Gow (Gnu on Windows).
If you want a truly manly command line for Windows, use PowerShell.

Custom (interactive) shell with Python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm currently trying to make some small shell-like utility for a custom script I wrote, so I can easily work with it (it's rather simple, so an interactive shell would be perfect).
Do you have any resources for me on how to create a shell in Python? I spent googling for a while, but all I could find was information about IDLE and similar Python interpreters. But I would rather want to know how to write a completely custom and command line based shell.
My approach would be hooking the stdin/out for commands, but given that the Python library offers so many great utilities, I want to make sure there if there is no better way.
The cmd module in the standard library could be a start -- if you have any trouble using it, please post more specific questions (ideally with some toy example showing what you're trying to achieve and what you're getting instead!).
You might have a look at pyparsing. It is definitely only about lexing and parsing, but that's definitely the hardest part of the problem.

Resources