Questions tagged [shell]

For questions relating to shells and kernels.

A shell is a piece of software that provides an interface for users of an operating system which provides access to a kernel.

45 questions
50
votes
5 answers

Is it a good idea to call shell commands from within C?

There's a unix shell command (udevadm info -q path -n /dev/ttyUSB2) that I want to call from a C program. With probably about a week of struggle, I could re-implement it myself, but I don't want to do that. Is it widely accepted good practice for…
John M
  • 511
  • 1
  • 4
  • 7
43
votes
4 answers

Difference between a REPL and interactive shell

Noob question. I am not quite able to tell the difference between a REPL and an interactive shell just by reading the definitions on Wikipedia. Wiki notes that REPL is a particular kind of interactive language shell. Is it a proper subset though?…
tchakravarty
  • 587
  • 2
  • 6
  • 9
20
votes
12 answers

Interviewing someone for general unix skills

How would you test a developer that claims to have *nix shell experience (just to be clear, we don't want to test if someone can develop on *nix, only that they know their way around the command line). I was thinking about making them solve a…
19
votes
9 answers

What were the reasons why Windows never had a decent shell?

I was reading a topic on SO: Why are scripting languages (e.g. ...) not suitable as shell languages?. Especially I liked the answer by Jörg W Mittag, from which I learned interesting things about Windows PowerShell. So after more than 20 years…
Ski
  • 420
  • 3
  • 9
17
votes
8 answers

What's shell script's advantage over interpreted programming languages?

(I'm not sure if it's a appropriate question here) Shell scripts, like those written in bash, can do many things. They can call Unix programs, pipe their output, redirect I/O from/to files, control flow, check whether a file exists, etc. But a…
Lai Yu-Hsuan
  • 291
  • 1
  • 2
  • 6
13
votes
3 answers

User Configuration of a Shell Script. Best practices?

I am writing a shell script with a few variables that should be configured by the user. There will be an installer for downloading and configuring the script, possibly by asking a series of question. The script in question is aimed at other…
10
votes
1 answer

Is it possible to use python as a shell replacement?

Recently I was looking at python's shutil and subprocess etc... And I started wondering: wouldn't it be ok to use python instead of e.g. bash? What am I missing?
xtofl
  • 334
  • 2
  • 10
9
votes
4 answers

Why empty function are needed

I started learning Python and I am wondering why empty function are needed in a programming language. e.g. in python: def empty_func(): pass Even in shell scripts empty functions are available. My Understandings and question: Why do…
jeyanthinath
  • 225
  • 1
  • 2
  • 6
5
votes
2 answers

Why most use Cygwin and not Uwin?

Most academic researchers I know target just *nix, and rely on Cygwin to make their applications available on Windows. I have tried many of these projects and always found them too unstable for serious use when running on Cygwin. Uwin looks like a…
user287424
  • 209
  • 3
  • 4
5
votes
2 answers

Functional programming: Writing a small interpreter

I'm working on a small Unix shell, and am contemplating the idea of writing a script interpreter. While reading about the subject I inevitably hear of functional programming, lambda calculus, and find out about the whole fascination around…
rahmu
  • 1,026
  • 6
  • 16
4
votes
1 answer

Why would I want to use CRaSH?

Justed stumbled across CRaSH and although it looks mighty interesting, I'm wondering why a Java developer should invest time & energy into learning (yet another) shell language. What sort of standard- and cool-applications can CRaSH be used for? Is…
herpylderp
  • 2,017
  • 3
  • 21
  • 27
4
votes
2 answers

Are "backwards" terminators for if and case unique to shell scripting?

In bash at least, if and case blocks are closed like this: if some-expr then echo "hello world" fi case $some-var in [1-5]) do-a-thing ;; *) do-another-thing esac as opposed to the more typical close of end or endif/endcase. As far…
4
votes
1 answer

Why no more macro languages?

In this answer to a previous question of mine about scripting languages suitability as shells, DigitalRoss identifies the difference between the macro languages and the "parsed typed" languages in terms of string treatment as the main reason that…
3
votes
0 answers

Writing shell extensions in C#: What are the risks?

Raymond Chen said in 2006 and repeated in 2013: Do not write in-process shell extensions in managed code But I am perplex since there even is a library which is exclusively dedicated to writing shell extensions in C# (called SharpShell). I am…
Nicolas Raoul
  • 1,062
  • 1
  • 11
  • 20
3
votes
3 answers

Recommended guidelines for declaring bash/sh variables

I have been programming in BASH for a while now and the scripts that I write are starting to get more complicated. I realized that I started to bring in some habits from C/C++ and wanted to get confirmation on if I needed to break my current habits…
1
2 3