Reason why a shell command behave differently depending on OS [closed] - shell

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
Like sed, there are shell commands which don't behave in the same way in the same shell.
Behavior of them seems to be different depending on OS (*BSD or GNU/Linux) not on shell though they are shell commands. I wonder at this. Could anyone please explain why shell scripting doesn't behave the same way on multiple platforms?

Different systems evolved their own tools and syntax, to a certain degree. Linux uses the GNU toolchain, which supports a variety of modern options. However, there is one thing that Linux and BSD (and many other Operating Systems) have in common: POSIX.
This is the POSIX specification for sed. You can rely on these working on all *nix platforms. There is usually a way to do whatever you're trying to do in a way that works with all versions of sed.
You'll also find the same inconsistencies between awk and gawk.

Related

Is it okay to run two instances of anaconda installing two things at once? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I just set up linux with WSL and am using anaconda to install standard packages.
It takes incredibly long (the solving environment variables part) and I want to install many things.
Can I run anaconda install on two different shells and be fine (using tmux not that it matters probably)?
I've never played with WSL but in general the package installation systems have a locking system that prevent parallel executions because they'll make the system inconsistent in some situations. So I think it should be fine but useless because the second process will be queued.

Can I use Bash on Ubuntu on Windows to practice Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I am a newbie to Linux. May I ask if I can practice Linux in Bash on Ubuntu on Windows? Sorry for asking such a stupid question. But please help!
Thanks!
If you are using windows 10, there is now a bash shell built in that can be easily set up. Check out this tutorial to do so.
If you are not on windows 10, I would recommend Cygwin (download) as an alternate program to run bash scripts
I think you will manage to get some familiarity with working with a linux console and some of the commands, however there is certain functionality which doesn't quite work.
What I would suggest though is dual booting Linux next to Windows, to immerse yourself properly and get a clear picture of things from the start.

Only English output from Windows command line tools [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
My windows application tries to parse the command result of command line tools and it works well in English language pack.
However, I was wondering if when customer is using a different language pack so if the result of the command is in Japanese/Chinese/Korean, I think I should modify the parsing logic accordingly.
I think this approach doesn't seem to be a right direction.
Is there any way to force English output ?
First of all you are not talking to MS-DOS because this is its own operating system. Windows no longer is build on a DOS base, the last versions that did so were Windows 95 and 98 I think.
You are calling command line commands / executables of Windows and they can't be forced to use all English. Perhaps you can interpret the return code and detect an error this way. Some tools can be forced to return csv (wmic for example) but I don't think sc can be.
My suggestion is that you search SO for a solution how to call the CreateService from your programming language.

How does Unix/shell scripting work? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I was just curious about the logic of a Unix environment. I'm under the impression that Unix is an operating system, but also a shell. As a subset there are more specific shells such as Bourne, Bash, and Korn shells. And these shells are interpreters and have their own functions to interpret scripts, and also have functions such as ping, pwd, etc? So there are shells within shells? Is everything I said correct?
The Unix operating system is not a shell.
A shell is just a program that makes it easy to interact with your computer by running programs and manipulating data streams.
The 'functions' you mentioned are programs, and not part of the shell.
You can run a shell from another shell if you want. For example, you are in a bash session and you want to switch to csh for something. You run csh and when you're finished, you exit to return to the bash shell.
If you like, you can run another copy of bash inside a bash session. You might do this if you want to modify some environment variables and then undo your changes when you return.
In all these cases, all you did was run a program from a shell and waited for it to terminate. If that program also happened to be a shell, it's nothing special.

GREP - What language is Linux / Unix utilities written in? [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
I was curious as to which language was utilities built into the Linux kernel was written in such as grep, cut, awk, find etc.
Are these compiled and can not be cat'ed and viewed?
The Linux kernel is written in C primarily. You can get it with:
git clone git://github.com/torvalds/linux.git
and then look at anything you please. Supporting commands, awk etc, can be found at GNU Software under 'All GNU Packages'.
The GNU tools can be found on the GNU project hosting page http://savannah.gnu.org/.
There you can review the source code of, for example, grep: http://git.savannah.gnu.org/cgit/grep.git.
Linux itself is not an operating system but the kernel. The tools you're mentioning form the so
called userland, which is separated from the kernel. Combining the GNU tools with the Linux kernel (and some glue) forms the GNU/Linux operating system.

Resources