Questions tagged [shell]
For questions relating to shells and kernels.
46 questions
3
votes
1
answer
149
views
Shell Script Design Patteren: Source a library file VS Call different files?
We discuss about POSIX compliant shell script here.
While we are writing more and more shell scripts, we build some helper functions to reuse the codes.
We are considering putting a few helper ...
-1
votes
2
answers
251
views
Delaying pods creation or recreating pods until tasks in other pods are completed
I need some help with better kubernetes resource deployment.
Essentially, I've 2 components. C1 and C2.
My task is to not deploy C2 pods or any resources until the tasks which are running in C1 are ...
-1
votes
1
answer
1k
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 ...
0
votes
1
answer
330
views
Are parser generators useful for parsing a shell language?
From my understanding, parser generators accept as input some form of context-free grammar description. The context-sensitive features are handled during semantic rather than syntactic analysis (...
0
votes
2
answers
259
views
Why not program our video text terminals/terminal emulators to use something JSON or XML on the backend instead of ANSI escape sequences? [closed]
Backstory (You can skip)
Awhile back I was developing a console toolkit for displaying debug messages and the like:
It gives me colour coding, blinking, underlines, bold, italic, etc.
While ...
0
votes
1
answer
208
views
Streamlining development process of Linux C++ CLI app [closed]
On Linux Mint 19 with C++ compiler version: g++-8 (...) 8.2.0
I am compiling and running my project named: getPixelColor
Using a shell script:
#!/bin/sh
g++-8 -std=c++17 -Wall -Wextra -Werror -...
-1
votes
1
answer
674
views
Shell Script does not capture values inside ENDSSH
I am very new to writing Shell scripts and am trying to write a simple script to run Vagrant up then SSH into the box and run some commands. The echo Hi there will run but the read -p will never show. ...
-2
votes
2
answers
199
views
How to call more than one program from a single process in an efficient way?
i want to call more than one process from the main program which is written in C++.
how to call them with the most efficient way given that one process may open and close more than one time.
the ...
50
votes
5
answers
11k
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
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
...
2
votes
0
answers
243
views
Implementing redundant GIT backup scheme
I want to push a local repo to multiple remote GIT repositories to achieve redundancy in my backup scheme. So, let's say I plan to use Github and BitBucket to host my repositories.
I have two ...
1
vote
1
answer
533
views
Unit testing C code?
I learnt about the check testing framework today that seems good. This far I've scripted tests that uses valgrind so that the tests both display output from the tests and from valgrind. Is there a ...
2
votes
1
answer
2k
views
When to malloc and free?
Valgrind does not report a memory leak during my actual usage, only during my scripted test that I scripted with a shell script to test my own shell. I found that I didn't have to use malloc every ...
2
votes
2
answers
171
views
algorithm for shell language interpreter to find if a char is between quotes
Assume we have a string s (a C char *) that is a program in a language L. I want to parse L and know the following from the specification
The following characters must be quoted if they are to ...
-2
votes
1
answer
295
views
For loop and recursion for a new shell in C [closed]
I code a new shell in C, that could be done in several ways: Flex/bison, finite state machine, abstract syntax tree or just a tokenizer in C. Now I've written a for-loop that changes the condition of ...