Questions tagged [unix]

Unix is a multitasking, multi-user computer operating system originally developed in 1969.

Filter by
Sorted by
Tagged with
3 votes
0 answers
252 views

Is there a conventional URI scheme for local sockets (AF_UNIX)?

I'm looking at creating a class which accepts a string to define a Unix socket address. Linux supports three types of addresses for Unix sockets: File based addresses (also called named domain ...
user avatar
1 vote
0 answers
58 views

Inter-Process Communication: Stream data from single writer process to multiple reader processes

tl;dr - I want to stream text data from one writer process to multiple reader processes. I'm thinking of using a file to achieve this. Is it a good idea? Using a file would avoid having to maintain ...
user avatar
2 votes
0 answers
68 views

Origin of the strftime %c format field order in POSIX locale

In standard POSIX locale strftime(buf, size, "%c", time) will format the date and time in an order that has confused me a number of times because it has month and day precede the time, but ...
user avatar
  • 372
0 votes
0 answers
44 views

Design time based job scheduler

Currently, I have a script install_crontab.py -u <user> -c <config> This script takes care of installing cron job that runs as a given user. In my install_crontab script, I check (using ...
user avatar
-1 votes
1 answer
160 views

Local Path on Linux [closed]

As we all know /usr/local/sbin, /usr/local/bin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games and /snap/bin are directories that Linux commands ( Except ones that built-in to shell and custom ...
user avatar
-1 votes
2 answers
78 views

commonly used practices for deploying package primarily composed of bash scripts

I am working on a tool that primarily uses bash scripts and C++ code. Generally I have experience with basic tools written in C and C++ in which we can have a build system like ./configure; make; ...
user avatar
1 vote
1 answer
123 views

Is it common to include a specific build of a library/ tool for production level project?

I am working with C++ in a Linux/ Unix environment. I am trying to learn the physical design of large scale projects. In one of my projects, I am using an SDK from a camera manufacturer. They released ...
user avatar
  • 123
-3 votes
3 answers
624 views

Ken thompson's compiler hack [duplicate]

I have gone through ken thompson's compiler hack paper, can't we just go through the complier's source code and check for any backdoor, what was the article's point? https://www.archive.ece.cmu.edu/~...
user avatar
1 vote
2 answers
418 views

Why terminals only allow character-cell displays

In wondering about math fonts in the terminal, I started to realize that you can't really have pixel-perfect graphics in the terminal: How to draw a single pixel in a terminal? Terminal with image ...
user avatar
  • 2,412
0 votes
0 answers
96 views

Cycle accuracy through the use of a microtable for an 8 bit CPU emulation?

I'm in the process of writing a 8 bit cpu emulator and currently have a jump table for different opcodes. I want to move this over to be cycle accurate and was wondering what the best approach would ...
user avatar
  • 176
50 votes
5 answers
10k views

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 ...
user avatar
  • 511
2 votes
2 answers
602 views

Ken Tompson Hack [duplicate]

I understand Ken Thmpson hack involved like someone has mentioned on here he hacked /bin/login to introduce a backdoor. he did this by hacking the compiler to introduce the backdoor into a binary ...
user avatar
6 votes
1 answer
698 views

Why does the C stdio 'ungetc' function exist?

In the C programming language (and many subsequent languages that either directly interfaced with or built a facsimile of the C's Standard IO functions), there exists a function called ungetc: int ...
user avatar
  • 4,439
1 vote
1 answer
98 views

What criteria should I use for determining whether or not to terminate a daemon (to restart it later)?

Should a daemon, forked from a CGI script (whenever the CGI script is called and the daemon is not yet running), hang running (most of the time just waiting for a connection) all time, or should it be ...
user avatar
  • 722
0 votes
2 answers
2k views

git clone vs cp -R

I want to use an existing project as a starting point for a new project by copying or cloning it. There are at least two ways of doing this. Method 1: Copy it. cp -R /path/to/source /path/to/dest ...
user avatar
  • 169
3 votes
1 answer
125 views

Kernel operation

I'm trying to grasp the concept of an operating system at the moment (on Unix-like machines) The kernel is the process with PID 0. Of course the Kernel is not really "just another process" because a ...
user avatar
  • 761
-5 votes
2 answers
399 views

How is "CURSES" a pun for "cursor optimization"? [closed]

I've begun implementing a support library for curses in Python. Along the way, I became curious why the project was called "curses" to begin with. According to one NCURSES documentation, the name is ...
user avatar
0 votes
1 answer
321 views

Using syscalls to read files - is this bad?

I have some (presumably stable) legacy C code that uses POSIX system calls to read binary files. It's nothing more than creat(), read(), and write(). The program doesn't sit close to the metal at all (...
user avatar
  • 223
-1 votes
2 answers
863 views

Creating an ASP.Net MVC web application that can work on different operating systems

I have been developing and deploying many ASP.Net MVC web applications under Windows Server 2008 R2 & Windows Server 2012 R2, and I used IIS 7 & IIS 8. At the same time I know that I can ...
user avatar
  • 107
53 votes
4 answers
4k views

What is the exact ingenuity of Unix pipe

I have heard the story of how Douglas Mcllroy came up with the concept and how Ken Thompson implemented it in one night. As far as I understand, pipe is a system call which shares a piece of memory ...
user avatar
  • 651
0 votes
0 answers
83 views

A callback for when data is received?

So, my understanding is that the Kernel could receive TCP at any time, and that generally a C program asks the Kernel synchronously/asynchronously if it has data available. Would it be possible for a ...
user avatar
6 votes
2 answers
510 views

Modern Interpretation of the Unix Philosophy of "Rule of Generation"

According to Wikipedia, Eric S. Raymond said that one of the 17 Rules of Unix is the "Rule of Generation", stating that: Developers should avoid writing code by hand and instead write abstract ...
user avatar
  • 269
0 votes
1 answer
153 views

Unix way of filtering/mapping/mapcatting records via the pipeline?

At home I use Linux and have for more than a decade. At work we use Windows and so I find PowerShell more familiar. I am a Linux/Unix fanboy at heart, but I've had greater success grokking the ...
user avatar
1 vote
2 answers
164 views

forking but not exiting

It is normal for the child in a fork() to call exec() or _exit(). Are there any realistic scenarios where the child might return from the function that called fork() instead? void foo() { pid_t ...
user avatar
  • 183
-1 votes
1 answer
117 views

"Grep" that highlights instead of filter [closed]

I was wondering if there is a program in the common unix toolset such as grep that instead of filtering the lines that contain a string, simply outputs the same input but highlighting or coloring the ...
user avatar
  • 111
2 votes
3 answers
128 views

Smart fallback for line endings in code files? [closed]

What do you recommend as a default fallback for line endings if the operating system cannot be determined? Example Mac OS up to version 9 uses carriage returns (\r) for line endings. Unix-like ...
user avatar
1 vote
0 answers
81 views

Storing last polled database timestamp unix

I have a Unix script which is called by a scheduler (CTRL M) every 3 seconds. The script queries an external database(not belonging to my application and therefore I can only query it) to check for ...
user avatar
  • 33
0 votes
3 answers
2k views

Programming with emacs instead of a debugger-integrated IDE [closed]

There's a question that might be deemed a duplicate of this one (I use an IDE (Eclipse) to develop software. Why should I switch to vim or emacs?) but I don't think answers my question. I usually ...
user avatar
3 votes
1 answer
643 views

Why do we need fork to create new process

In Unix whenever we want to create a new process, we fork the current process i.e. we create a new child process which is exactly the same as the parent process and then we do exec system call to ...
user avatar
  • 199
0 votes
1 answer
120 views

What is a cross-platform way to expose an Array[][] over a webservice? Any JSON nuances to be aware of?

I need to expose an Array[][] to many different clients (iPhone, Android, PC, Unix, etc), and need to make it available over HTTP/s This brings me to JSON, and makes me wonder how do all the other *...
user avatar
0 votes
2 answers
1k views

Why to have an application with GUI on linux when command line is available?

If the question appears to be off topic then please migrate to some other suitable domain on stackexchange. Q.why to have GUI along with CLI, when you already have command line interface? I'm ...
user avatar
  • 133
1 vote
2 answers
495 views

Examples of UNIX Domain Socket Usage [closed]

Can anyone give an example of instances in which the AF_UNIX i.e unix domain sockets are used for process communication in a unix-based system
user avatar
  • 3,237
4 votes
2 answers
513 views

Origin of the name “OpenServer” for the SCO Unix operating system

I was looking over the evolutionary history of Unix and Unix-like systems on Wikipedia and one operating system name stood out to me: OpenServer. Judging from the image, SCO's OpenServer is ...
user avatar
0 votes
3 answers
120 views

How to manage intermediate outputs efficiently?

I am implementing a C preprocessor in C... I have the three functions: trigraph replacing function Line splicing function comment removing function However these functions work separately on files ...
user avatar
  • 101
12 votes
3 answers
10k views

Lowercase in Linux file names

As I find that UpperCase are really readable for first letter word separation in long complex names, I tend to give some of my Linux files names with some UpperCase. Mostly executables, some ...
user avatar
1 vote
1 answer
3k views

Round Robin - how to determine the optimal quantum of time?

I have to calculate the proper quantum of time for Round Robin process scheduling algorithm. As I read in Tanenbaum's book, the quantum of time should cover like 80% of the running time of all ...
user avatar
170 votes
11 answers
52k views

Is Ken Thompson's compiler hack still a threat?

Ken Thompson Hack (1984) Ken Thompson outlined a method for corrupting a compiler binary (and other compiled software, like a login script on a *nix system) in 1984. I was curious to know if modern ...
user avatar
0 votes
2 answers
508 views

Parsing stdout with custom format or standard format?

To integrate with other executables, a executable may launch another executable and capture its output from stdout. But most programs writes the output message to stdout in custom format and usually ...
user avatar
  • 1,120
3 votes
1 answer
184 views

Is this possible to re-duplicate the hardware signal on Linux?

Since that every things is a file on the UNIX system. If I have a hardware, for example, a mouse, move from left corner to right corner, it should produce some kinds of file to communicate with the ...
user avatar
  • 1,579
6 votes
3 answers
971 views

What are the options for setting up a UNIX environment to learn C using Kernighan and Richie's The C Programming Language?

I'm a novice programmer and have been experimenting with Javascript, jQuery and PHP but felt I wasn't getting a real depth of understanding of what I was doing. So, after reading Joel Spolsky's ...
user avatar
  • 679
3 votes
2 answers
302 views

Need some advice on CLI design, I need to provide simple but powerful command line options

I am writing a utility that runs on RHEL5 command line. I need my command line options to be simple but powerful. I looked at the various UNIX utilities to get an idea of how simple command line ...
user avatar
5 votes
2 answers
5k views

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 ...
user avatar
18 votes
3 answers
3k views

Why is the "kill" command called so?

Why was it decided to call the kill command "kill"? I mean, yes, this utility is often used to terminate processes, but it can actually be used to send any signal. Isn't it slightly confusing? Maybe ...
user avatar
  • 2,384
24 votes
8 answers
4k views

Any basic difference between Unix and Linux in design and other aspects? [closed]

I keep reading this sentence: Linux is a Unix-like system, but it is not Unix. I don't know what's the real difference between the two. I know Linux got a lot of ideas from Unix and the licenses ...
user avatar
  • 2,025
3 votes
4 answers
3k views

Ubuntu, OpenSuse, the world of linux for a web-developer

I'm learning web development. My main OS is windows 7 but I've used Linux and currently dual-booting with Ubuntu. My Linux knowledge however, is pretty limited. I can work with the command line on ...
user avatar
21 votes
3 answers
12k views

Simple explanation of the Unix sockets

I can search and I've already looked at the wikipedia entry and in some other places, but even though I have some programming experience, I don't really grasp the concept. Can you treat me like a 10 ...
user avatar
2 votes
4 answers
3k views

Unix as opposed to Windows (Java and C++) [closed]

Firstly I should explain the background. I am interested in high frequency trading programming roles. After looking at many job specs it is very clear that there is a big demand for programmers who ...
user avatar
  • 1,411
6 votes
1 answer
822 views

How to understand the beauty of UNIX? [closed]

Some of my friends say that UNIX is beautiful and simple. But I really don't know what they mean. Why are they saying so? For me, UNIX is just a boring command prompt with different shells. How can I ...
user avatar
  • 1,579
20 votes
12 answers
15k views

Interviewing someone for general unix skills [closed]

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)....
user avatar
5 votes
2 answers
1k views

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 ...
user avatar
  • 1,016