Questions tagged [unix]
Unix is a multitasking, multi-user computer operating system originally developed in 1969.
58
questions
0
votes
1
answer
117
views
Using sed/awk to bulk generate static HTML pages off of a template
Hypothetically, consider a social photo platform - each pic gets its own url, this page contains the image, text about the image, buttons for the user to click, related pics, and some user-specific ...
4
votes
0
answers
928
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 ...
1
vote
0
answers
73
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 ...
3
votes
0
answers
116
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 ...
0
votes
0
answers
66
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 ...
-1
votes
1
answer
503
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 ...
-1
votes
2
answers
84
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; ...
1
vote
1
answer
132
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 ...
-3
votes
3
answers
708
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/~...
1
vote
2
answers
537
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 ...
0
votes
0
answers
99
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 ...
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 ...
2
votes
2
answers
660
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 ...
6
votes
1
answer
812
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 ...
1
vote
1
answer
99
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 ...
2
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
...
3
votes
1
answer
132
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 ...
-5
votes
2
answers
438
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 ...
0
votes
1
answer
376
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 (...
-1
votes
2
answers
897
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 ...
54
votes
5
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 ...
0
votes
0
answers
94
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 ...
6
votes
2
answers
542
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 ...
0
votes
1
answer
195
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 ...
1
vote
2
answers
240
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 ...
-1
votes
1
answer
120
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 ...
2
votes
3
answers
130
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 ...
1
vote
0
answers
85
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 ...
0
votes
3
answers
3k
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 ...
3
votes
1
answer
658
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 ...
0
votes
1
answer
126
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 *...
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 ...
1
vote
2
answers
502
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
4
votes
2
answers
560
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 ...
0
votes
3
answers
127
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 ...
12
votes
3
answers
11k
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 ...
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 ...
174
votes
11
answers
55k
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 ...
0
votes
2
answers
547
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 ...
3
votes
1
answer
186
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 ...
6
votes
3
answers
991
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 ...
4
votes
2
answers
318
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
6
votes
1
answer
854
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 ...
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)....