Object-Oriented Shell for Linux

what object-based shells are there?

Perhaps you may want to take a look at Pash.

It is an open source implementation of the PowerShell for other platforms. For educational purposes and inspiration it might be useful. Unfortunately, as far as I can see, this promising project is not being developed.

Creating classes and objects using bash scripting

Bash is a scripting language, that doesn't support OOP, so you can't. Try Python.

The only other thing you could do is have several arrays, but that's messy. Use the index to link them.

A better Linux shell?

You can run PowerShell on Linux via Pash. It uses Mono the way PowerShell uses .NET.

Can a list of objects be made and operated on in a BASH environment

Here is the example of what you want:

samples=(sample1 sample2 sample3)
currentSample=${samples[0]}
echo "$currentSample"
echo "${samples[0]}"

Output:

sample1 
sample1

As you can see you can assign array's value to a variable or use its value directly.

Moving from Bash Linux shell for any window's shell tool. How to start and which tools to use?

What Hyper Anthony said: https://stackoverflow.com/a/573861/775544

-- What are the pros and cons about CMD and powershell ?

PROs:

o Microsoft provides cmdlet modules for many of their Tier-1 products so that you can manage them directory from Powershell (e.g.: Windows Server, AD, SQL Server).

o Powershell can utilize many .Net functions (if not all of them, but some require tricky delegation code) giving you access to everything on the server.

o Powershell works natively with COM, WMI, ADSI, the Registry, the cert store, etc. (1)

o Object-oriented

o Multi-tasking/mutli-threaded jobs. The new workflow capabilities allow complex workflows to be (relatively) easily encoded.

CONs:

o CMD shell. Once you start using the Powershell, you may never need the CMD shell (the only times I use CMD is when I know a command that works in CMD but not in Powershell and I'm too lazy to find the Powershell variant).

o CMD can't do multithreaded.

-- Is there any other option?

As others have mentioned, cygwin. I used cygwin for about a year when I switched from Solaris admin to Windows. Eventually I had to migrate to CMD just because there were some instances where cygwin wasn't mature enough to handle some tasks (I don't recall what those were).

-- Is there any good tutorial or reference that I could learn?

Tons! I typically search for code samples on internet and learn from those. I also follow the Scripting Guy blog http://blogs.technet.com/b/heyscriptingguy/.

What is your experience in this scenario?

I was a Solaris admin that scripted in Bourne shell and moved to Windows admins in the Time-Before-Powershell. I used hybrid cygwin/cmd shell for a while then moved on to VBScript/WMI until Powershell v2 came out. I have a background in SW development so I really took to Powershell's OOD.

I typically home-brew my own cmdlet modules rather than download from the web, but there are a lot of well-written cmdlet modules on the web that you can utilize.

(1) From Jeffery Snover's article at Is PowerShell ready to replace my Cygwin shell on Windows?

What is a good IDE for working with shell-scripting in a Windows environment?

I found a cool Online IDE, which will perhaps help me to write simple bash scripts.

Here it is: Ideone.com

Which language is suitable for Linux and related programming?

The best way to decide which language is going to be useful to you is to look at the source for the projects to which you wish to contribute. Take a look around popular code repositories, such as github, google-code and sourceforge.

Diving into a language like python may be useful for some scientific projects, but not at all useful for something low-level like linux-kernel development.

I want to make kernel patches

The Linux kernel source tree is currently:

  • 96.5 % c
  • 2.2% assembly
  • 1.3% "other" (documentation and makefiles, presumably).

So start with The C Programming Language and go from there!

Good luck!



Related Topics



Leave a reply



Submit