Nushell pricing12/4/2023 Jonathan: Yehuda and I have been writing Rust for at least 4 years. NuShell screen capture Why use Rust? How much experience did you have beforehand? And, being crossplatform, it’s nice to learn this approach and then be able to easily switch operating systems and use the same techniques. In a way, it’s taking the original spirit of Unix - where you use pipelines to combine a set of tools - and imagining how that original spirit would work today, with what we know about programming languages and tools. ![]() In a way, Nu is a way of saying “what if we didn’t need tools like awk so often?” Since you’re working with structured data, as we add more support for file types, it’s less often you need to reach for “awk”, “jq”, “grep”, and the array of other tools to open and work with common file types. Then you have a set of commands that work with these tables, to help you get the data you want, change it, view it, etc.įunny that you mention “awk”. Files, streams, commands like ls and ps all output this one table format. The basic idea is pretty simple: Nu opens everything into a table you can work with. He had just been experimenting with PowerShell and saw how adding some structure to the data opened up a lot of possibilities. When Yehuda and I first started discussing how shells could be improved, we settled on the idea of using structured data rather than just text between applications (for example stdin/stdout). Jonathan Turner: Sometimes the simplest ideas are the ones that hook you the most :). Why create NuShell? Is it me or does it have a next-level AWK vibe? We wanted to learn more about NuShell so we interviewed both of its creators: Jonathan Turner and Yehuda Katz. It brought some big changes, which include rethinking how pipelines work, structured input/output, and plugins. Until NuShell appeared to reinvent shells and defy our muscle memory. Line_numbers = list(map(int, line_numbers_str.Shells have been around forever and, for better or for worse, haven’t changed much since their inception. # convert the entered line numbers to a list of integers Line_numbers_str = input("Enter line numbers to delete (separated by commas): ") # ask the user to enter line numbers to delete # print the initial contents of the file in a table format # set the file path to the history.txt file in the nushell config directoryįile_path = os.path.expanduser('~/.config/nushell/history.txt') # print each line number and the corresponding command # if it's not, write the line to the file # check if the current line number is not in the list of line numbers to delete ![]() # read all the lines and store them in a list ![]() Utilizing this information, it is possible to accomplish what you asked by using my script below: nushell_history_manager.py import osĭef delete_lines(file_path, line_numbers): However, the code indicates that the history.txt file is located at ~/.config/nushell. Based on the code that I can read here and on the documentation here, it appears that an option like this is not currently available.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |