Skip to main content

Questions tagged [programming]

Questions about tools for programming (compilers, IDE, etc.) For questions that involve programming, ask on Stack Overflow.

Filter by
Sorted by
Tagged with
0 votes
1 answer
15 views

Keyboard buffer management

On Linux, when a shell is running a process it usually allows you to keep typing commands which will be processed when the process finishes. The same can be observed in other applications that behave ...
A_A's user avatar
  • 173
1 vote
0 answers
25 views

Running a program/script before a user logs in on RedHat Linux GUI

I am looking to run a script prior to a user being able to log in on the GUI. Its a basic script, do you accept Ts&Cs Y/N, enter user name, data is captured and stored. Then once complete takes ...
K_Sparky1029's user avatar
0 votes
0 answers
53 views

How to "wake-up" user space threads from kernel?

Suppose you have a kernel device driver receiving data and a user space threads waiting for the data. You want to avoid wasted cycles by having the user space thread block and wake-up once the kernel ...
FourierFlux's user avatar
0 votes
0 answers
52 views

Geany: Possible to automatically enable/disable line wrap dependent on file type?

In Geany text editor / IDE, is there a way to tell it to automatically enable line wrapping for certain file types, but not for others? For example, for .txt files, I would like it to always enable ...
End Antisemitic Hate's user avatar
-4 votes
1 answer
79 views

Why build a .deb package vs simply including files? [closed]

I'm confused as to why you would create a .deb package vs simply putting your program in a folder + additional files and writing an install script. What are the value of packages?
FourierFlux's user avatar
-1 votes
1 answer
55 views

Searching for an old laptop to learn linux [closed]

I have years of experience in programming algorithms and compiling statistics. Now I would like to develop my skills and immerse myself in the world of Linux in order to get more involved with the ...
PaiThon's user avatar
  • 15
1 vote
2 answers
1k views

Is there a way to do namespaces like in C for bash?

What I'm talking about is like in C, you get to use namespaces with the statement using namespace blah blah blah, can you do the same thing but in bash?
trent's user avatar
  • 27
0 votes
1 answer
281 views

Are there Visual Studio -like tools for creating forms in Linux?

I want to create forms in Linux. I create Windows forms, but for example if I was to use Linux to develop is there any software I could use to create a form like you would in Visual Studio?
gsmyth377's user avatar
1 vote
1 answer
157 views

Sending data with raw socket over gretap

I'm trying to write an IS-IS packet to gretap interface with ISO (0x00fe) protocol type. In this case there is no ethernet header so I'm using raw socket. The gretap always puts 0x6558 as the protocol ...
Barry's user avatar
  • 21
1 vote
2 answers
357 views

Linearizing a fasta file and removing special characters in

I linearized a fasta file using using awk on a remote computer. when I used nano to open it, it showed that the file had linearized. However when I downloaded the file to my local computer, and I ...
thole's user avatar
  • 33
0 votes
1 answer
36 views

How can I en- and decompress a bootable image?

I have a bootable kernel image, that I had created with MinGW Toolchain's that available for Microsoft Windows 11. The Project is in size tiny, but I would know: "How can I shrink the image, if ...
Jens's user avatar
  • 1
4 votes
2 answers
7k views

Creating a bash script to install packages

I'm quite a newbie when it comes to bash. I'm trying to create a script that checks whether a package is installed or not. If not it will install that package. Not sure what I'm doing tbh. #! /bin/...
Scriptkid_bash's user avatar
0 votes
2 answers
1k views

Change permissions on symbolic link [duplicate]

I'm starting in programming with multiple exercices and I don't know how to change my link permission (lrwxrwxrwx to lrwxr-xr-x). I have already searched solutions from Google and Youtube but nothing ...
Raph's user avatar
  • 1
0 votes
3 answers
61 views

Quoting rules in a complex situation

When writing lines of code we sometimes need to consider escaping some characters. I have come across a situation that I cannot answer on my own In PHP, the exec command requires a string enclosed in ...
Luca Zappi's user avatar
0 votes
1 answer
64 views

EPROTOTYPE (_SIGN 41 ) while creating raw socket() in MINIX 3

The following is my code snippet that is producing EPROTOTYPE error, aka, Protocol Wrong Type for Socket. I checked for the headers in /usr/include in MINIX 3, sys/socket.h contains definitions for ...
Reiki Yamya's user avatar
5 votes
3 answers
910 views

Tool to detect errors in application's execution logic

I want to detect errors in application's execution logic. E.g.: forgot to call free() on address returned by malloc() did not close file handle returned by open() invalid flags passed to open() ...
zomega's user avatar
  • 972
1 vote
0 answers
58 views

A minimal virtual unix shell environment as a library for games

I've played a few games in the past that had somewhat unix-like shell environments, but which were clearly missing major portions of the system because the developer had simply not bothered to ...
Hate9's user avatar
  • 21
-5 votes
1 answer
114 views

How to make CLI applications in Unix? [closed]

How are apps like vim and w3m built? I was trying to find info about this online but I couldn’t really find much.
noatbfgtxa's user avatar
0 votes
4 answers
142 views

Scoring from input in Bash

Can you help me please? I have a task. I have from input some text with numbers. For example: beta 1 score 9 something 2 beta 4 something 1 I need to calculate all numbers with the same ...
lolilaliaa's user avatar
1 vote
1 answer
113 views

Linux mint - classify an application correctly in the start menu

Mint auto-classifies applications into categories in the start menu. I use this classification to navigate apps more easily. Recently I have installed Eclipse IDE and Mint failed to classify it as &...
Aviv Aviv's user avatar
  • 131
-1 votes
3 answers
4k views

What does it mean to both append and prepend a value to a variable (in fish shell or in general)?

Per the fish shell documentation for the set command: append: causes the values to be appended to the current set of values for the variable. This can be used with --prepend to both append and ...
Pound Hash's user avatar
0 votes
1 answer
130 views

Remove null variable name and value both while echoing in a single string

i have the below condition where values are as below. emp_name="Sid" emp_id=1234 emp_hobby="" emp_likes="swimming" emp_dislikes="" emp_summary="emp_name:$...
Casata's user avatar
  • 3
0 votes
2 answers
296 views

What is lsh_ used for and/or what is it doing?

I am new to programming in Linux and I am quite confused. I notice the lsh_ prefix is used for function names here. I'm not sure why. The only thing I can find on the internet is that lsh could ...
Tricepticon's user avatar
2 votes
1 answer
912 views

get event when user has selected a text in any window in X11

I want to write an app that shows a popup-menu after a user has selected a text in any window in Linux (debian based). Mac users may know "PopClip" (https://pilotmoon.com/popclip/) and as I ...
dirkc's user avatar
  • 31
0 votes
1 answer
693 views

Bash script printing expression instead of result

I am trying to calculate multiplication of number of arguments and first argument provided by the customer. here the arguments are 10, 15 so total number of arguments is 2. Now i want the shell to ...
Nagarjuna's user avatar
1 vote
1 answer
283 views

Ensuring only 1 mandatory parameter is passed to script

I am writing a shell script and new to getopts for parameter parsing. What I have are 1 optional and 2 mandatory parameters and what I want to do is ensure that only one mandatory parameter is passed. ...
aika's user avatar
  • 13
1 vote
1 answer
53 views

how to repeat values of B variable till number of A variables are finished

I have infile with values for 2 variables # cat infile A 1 B 2 C D E I want to read variable a & b, so that if $b has null value, it should repeat like 1..2, till all $a values are read. so if I ...
Sollosa's user avatar
  • 1,951
2 votes
2 answers
3k views

Missing header file linux/io_uring.h

#include <linux/io_uring.h> main.c:1:10: fatal error: linux/io_uring.h: No such file or directory #include <linux/io_uring.h> ^~~~~~~~~~~~~~~~~~ Kernel version 5.4.0-80. I ...
fullnitrous's user avatar
2 votes
1 answer
1k views

How to reposition the elements of a json array conditionally using jq?

I want to re-position elements of an array (change index of array elements) based on a condition. I don't know how to translate this to jq which is more of a functional language. Basically I want to ...
Zeta.Investigator's user avatar
2 votes
2 answers
4k views

How to generate thumbnails/previews for files?

I wrote an app for Windows and macOS and I am in the process of porting it to Linux. My app has a file browser implemented and can display thumbnails or document icons of files. On Windows I get ...
HelloWorld's user avatar
0 votes
1 answer
40 views

How to make a script which create a file with the info i want?

i'm a newbie on Linux here and i was hoping to find help. I was using Centos and i've found an exercise where i have to create a script. This script should create a text file with the network ...
RedXBrain's user avatar
0 votes
2 answers
2k views

Printing to the STDOUT vs writing to an output file directly [closed]

Is there any rule of thumb when the result of the program should be printed to the stdout by default, and when the more appropriate approach is to accept output file as one of the arguments and write ...
Al Bundy's user avatar
  • 181
0 votes
2 answers
117 views

using command subsitition in a bash for loop

I am probably making an obvious mistake but I could use a strong hint:-) for file in *; do ls $file | var=$(ls $file | grep -Eo '.{18}$' | cut -d '.' -f1 |sed 's/.\{12\}/&./'); echo "var is $...
Jeroen1000's user avatar
-1 votes
1 answer
56 views

LXML Clarifications... Pretty, but complicated!

I have only recently met this lib and the first impact was not pleasant at all! First of all, from this site https://lxml.de/ I don't know about you, but I didn't understand anything! Too complicated ...
vincenzogianfelice's user avatar
0 votes
1 answer
164 views

Does the shell script interpreter optimize if else chains?

As far as I understand, an interpreter runs code line by line; but I find probable that my reasoning is incorrect. If in this example case the first if line returns true, will the program know to skip ...
Hermitao's user avatar
-3 votes
1 answer
46 views

Perl having problem in programme execution [closed]

#!/usr/bin/perl #Script:name2.pl - Demonstrates use of chop # print("Enter your name:"); $name=<STDIN>; $lname = chop($name); #Removes newline character from $name ...
Shridhar B Waghamare's user avatar
0 votes
1 answer
358 views

Flip-flop in shell

In Wikipedia there are two relevant articles about the term "Flip-flop": Flip-flop (electronics) Flip-flop (programming) I think that there is a formal-logic common denominator between the ...
timesharer's user avatar
0 votes
2 answers
85 views

awk to vlookup and print

I got a comma-separated file # cat data smartplayer,2222,off smartplayer,1111,on scorer,0000, I want to search for smartplayer in $1, get its state from $3 and print like this off-smart-player 2222 ...
Sollosa's user avatar
  • 1,951
1 vote
0 answers
89 views

Convert jpg to bmp in an ARM Cortex M4 MCU

I'm currently working in a project that involves the use of an ARM cortex M4 MCU, specifically STM32F429, which has an embedded LCD controller which uses the bmp image format to show the images in the ...
Alejandro Garcia Navarro's user avatar
1 vote
2 answers
4k views

Locating the C header "stdio.h"

I wrote my first C program which is the generic "hello world" program. Could anyone please tell me where can I find stdio.h file in my system? It will help me a lot in understanding of the ...
Ashutosh Mishra's user avatar
0 votes
1 answer
27 views

How does many binaries changes the percent number of the execution in its right place?

I'm trying to write a C program which can do the thing that many binaries such as package managers do in execution time. They change and add to the already outputted texts in terminal and it makes it ...
zbx0310's user avatar
  • 47
1 vote
0 answers
257 views

How can I listen to port creation events on a network interface?

I would like to create a TUN interface (following this tutorial) that takes specific actions when a listening port is created on it. Those include logging the application that created the port, which ...
PoultryMan's user avatar
2 votes
1 answer
142 views

Pipes and graphics

When developing a program (in C or Python, say), I often write debug messages to see whether my program behaves as intended. On Linux, such text messages can be handled in varied and flexible ways ...
Erik Aas's user avatar
  • 121
0 votes
0 answers
171 views

How do programs accessing symbolic links differ from users? (What scenarios can break by replacing a file with a symbolic link?)

I think I understand what soft and hard symbolic links are, but I'm not sure how programs access them (as opposed to me, a user). For example, I want to replace my ~/.bashrc with a symbolic link that ...
Andrew Cheong's user avatar
0 votes
2 answers
6k views

How to get into python environment and run some python commands and return to normal terminal using shell script

Sorry about the title it may not be clear. Here is the complete explanation of my doubt. I am writing the below shell script and expecting the mentioned output. #!/bin/bash python3 print("Hello ...
Rakesh Nara 10's user avatar
1 vote
1 answer
278 views

"Pinging" using DNS protocol

Is there accepted "good practice" for checking that the network connection to a DNS server is operational, and that the server responds minimally, other than issuing a lookup request? ...
Mark Morgan Lloyd's user avatar
0 votes
0 answers
181 views

End process but resume bash script?

I am trying to create a script in which part of it runs a command that can only be stopped by the user sending SIGINT to the process. I want the user to be able to press Ctrl+C to end that part of the ...
jethr0's user avatar
  • 11
1 vote
0 answers
25 views

How to give stdout to different program on same line? [duplicate]

I could do it long way i.e cat hi.txt | grep 'important url' > imurl cat hi.txt | grep -v 'not important url' > imnoturl cat hi.txt | otherprogram1 cat hi.txt | otherprogramN However, is there ...
Machine Yadav's user avatar
0 votes
0 answers
94 views

how to use plantUML after installing PowerTools?

On the understanding that PowerTools includes plantUML I've installed and enabled the package. How do I now invoke plantUML to use it? (Although I now realize that the above link is actually for ...
Nicholas Saunders's user avatar
0 votes
1 answer
164 views

How to configure flatpak on CentOS?

I don't believe flatpak is configured: $ lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 8.2.2004 (Core) Release: 8.2.2004 ...
Nicholas Saunders's user avatar

1
2 3 4 5