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
1answer
365 views

Possible to replace string if match string in two files? [closed]

i am aware of this doable by sed but only limited to one string let me explain let better, lets say in file 1 we got something like this tom,123456789 steve,1478321 jon,315457 and in the second file ...
1
vote
1answer
2k views

Wine not working for Linux Mint 18 Sarah. Trying to run Game Maker Studio, with no luck

I'm using Linux Mint 18 Sarah MATE 32 bit and I'm trying to download Game Maker Studio off of Wine 1.6.2. It was named "GMStudio-Installer-1.4.1763.exe". At first the installation process went ...
1
vote
1answer
60 views

Server response login error!

This is the script i build for i in `cat cain.txt` do uuid=$(curl -X POST -H "ACCEPT-LANGUAGE:en" -H "Content-Type:application/json" -H "Accept: application/json" -d '{"username":"TheUserName"}...
-1
votes
1answer
101 views

C++ Apps ready for Linux as well as Windows? [closed]

I don't actually know where to start and what keywords to use for searching more, but can we simply make a programs in C++ that runs in Linux as well as Windows. I guess we are talking about binary ...
-1
votes
1answer
170 views

Append value as parameter to shell script

I found the value of a response (curl) with sed and now i need some help to take the value that i printed in a file and to use it in another substring in the same .sh script This is the response of ...
-1
votes
1answer
62 views

An executable has two processes and is launched twice on two different terminals How to make the processes identify their roles

I have to write a c code which will contain two processes. And its executable will be launched twice on two different terminals. Both processes will know whats their role. One terminal will show ...
0
votes
3answers
721 views

Bash math & files [closed]

I need to do some math with the lines of a file and a number using bash. As in Ruby or python you can easily do string to number or viceversa. In bash all is untyped. I have a file contain numbers ...
0
votes
1answer
97 views

Unix program for random image generator [closed]

I want to create a basic program in Unix that would display in HTML a random photo from a group of photos I selected and each time it is generated a different one would be displayed, hence random. ...
-1
votes
2answers
207 views

How to deal with C makefiles under the “Unix as IDE” philosophy?

I've been for long using VIM as my main editor and never touched an IDE since. This works great for most of the programming languages on the market. When it comes to C, though, I still fell limited to ...
0
votes
1answer
50 views

Move files shell program

Hello i have got problem, on shell program(.sh), with this code I should copy the file JPG from the directory sorgente to destinazione but the code does not work, can you help me!! #!/bin/bash ...
42
votes
2answers
68k views

How to step-into, step-over and step-out with GDB?

I typed help while I was in the GDB but didn't find anything about step-into, step-over and step-out. I put a breakpoint in an Assembly program in _start (break _start). Afterwards I typed next and it ...
16
votes
3answers
10k views

How complex can a program be written in pure Bash? [closed]

After some very quick research, it seems Bash is a Turing-complete language. I wonder, why is Bash used almost exclusively to write relatively simple scripts? Since a Bash shell comes with Linux, you ...
8
votes
1answer
144 views

How do I usefully report a bug [closed]

I've used Linux Mint for a while now and I'm quite the fan. I'm not expert enough to go messing with the kernel or anything like that, but I've noticed small bugs in a couple of software packages that ...
-3
votes
4answers
87 views

Transforming letters in columns into numbers

I want to transform the letters in two columns into numbers. In the following example I want to change the letters in column 2 and 3 for numbers, so that A is changed to 1, B into 2, C into 3 and G ...
0
votes
2answers
245 views

Command “paste - - - - ”, how to specify a big column number

In command paste - - - -, numbers of - is equal the future column number. In my case, I have 55,000 future column, for me wont need to put 55,000 - what I will can use? Example: title1:A1 title2:A2 ...
1
vote
1answer
406 views

BASH dd problem

i am trying to learn bash and now im trying to do a script for burning isos. I made the number "4" command to make sure the variables were right. the message i get when i complete my program and ...
-1
votes
1answer
581 views

What is the Lua language used in Conky script? [closed]

I've been experimenting with Linux on a spare PC using Crunchbang so that I can try changing things and tinker. The Conky system monitor is fun to work with and changes are immediately seen, so it's a ...
0
votes
2answers
80 views

What OS should I use? [closed]

I recently started JAVA programming and I would like to start learning Linux programming simultaneously. I run a mac and I am planning to use Oracle VM VirtualBox to boot linux. What kind of Linux OS ...
1
vote
1answer
98 views

Simplest way to add a data lookup to an HTML website on Ubuntu?

I want to learn how to make the simplest possible data lookup function on a website. I don't want to use any of the usual tools such as MySQL or a CMS or any other heavy framework. I set up an Ubuntu ...
2
votes
1answer
129 views

Why doesn't cc (the C compiler) and similar utilities use standard streams by default? [closed]

Background If think most of us agree that filters and pipes are the very foundation of Unix systems. Pipes and filters are very powerful tools. Almost all Unix utilities use the standard input and ...
2
votes
2answers
444 views

Trying to convert a simple C program into an AWK program

Hey guys a couple of weeks ago I wrote a C program that prompts the user for the name of a text file and then prompts the user for a word. The program then outputs the input text file with numbers to ...
1
vote
1answer
76 views

vim: Match WORD in current block with balanced brackets

When matching in vim there are words, WORDs and blocks among other things. Now for editing code, blocks are useful, words are somewhat useful, but WORDs are mostly useless, because they often include ...
-2
votes
1answer
43 views

C Program Problem [closed]

#include<stdio.h> int main(void) { int a; int count=0; for(a=1;a<=10;a=a+1) { if(a>3) count=count+1; } printf("%d numbers were greater than 3\n",count); return ...
-2
votes
1answer
69 views

Creating shell script with bash scripting [closed]

I want to make the script to extract the users of linux server and check if "/home/$user/public_html/vb/includes/config.php" is exist , i want the script to check all the users in the server and ...
1
vote
1answer
182 views

`man` pages for languages other than C (e.g, python, R, javascript, etc)?

man pages are a phenomenal resource while programming in C on Linux. While looking at someone else's code, if you see something foreign you can immediate research it in another terminal with $ man 3 ...
2
votes
0answers
54 views

What is the background of the program segmentation?

Each program is separated into several segments like: code segment data segment stack segment heap segment But who was responsible for that progression? The compiler and linker has to support that ...
24
votes
3answers
6k views

Will my linux binary work on all distros?

I found a good replacement IDE for Delphi called Lazarus. But I don't have a question for programmers. Will the statically linked Linux binary work on all Linux distributions? I.e. it does not matter ...
1
vote
3answers
201 views

What is the reasoning/design choice behind the unix/linux file system structure?

I've recently switched from using windows and I'll now be running linux on my computer. In windows there's the program files folder. Most of a programs files go into its own folder there which to me ...
2
votes
2answers
2k views

Linux System calls in C on OSX

So I did a quick test and #include <sys/types.h> #include <unistd.h> #include <stdio.h> int main (int argc, char *argv[]) { printf("Hello World\n"); printf("%d\n",...
1
vote
1answer
142 views

Is there a tool that automatically inserts and updates a script header block for e.g. shell or Python scripts?

I found scripts by a former admin who scripted quite nice things with Bash or Python. All his scripts are well formatted and equipped with a always similar looking "script header" or "code header", I ...
1
vote
1answer
76 views

Running a program and providing input

I have a program that runs from the command line. As soon as it runs, it asks for a text value and expects the return key to be pressed after that. Is that possible to create a bash script that runs ...
0
votes
1answer
61 views

How should I write a test environment for my program?

If I have a program, its input and the desired output, how do I automate the comparison of what I want the program to give me and what it actually gives me? For example: a=${./program < inputfile} ...
1
vote
0answers
167 views

Passing a parameter to a dstat plugin

I wrote a simple plugin (dstat_externalBackup.py) for dstat to monitor the filesystem free space and placed it in /usr/share/dstat and it works as intended. € dstat --externalBackup 3600 extern free ...
0
votes
1answer
340 views

Can I use LXC library in my c program?

Currently, I am designing a c program that will create multiple container and put different applications into them separately to achieve isolation. Is it possible to leverage LXC library to it? I ...
2
votes
1answer
48 views

Storing one bit of information in user space [closed]

I'm writing a program that collects network data. I need to store one bit of information, a simple yes/no, somewhere so another process may read it. I have several options: writing a 1 or 0 to a file, ...
0
votes
1answer
100 views

writing to ext4, 8GB partition vs 512MB partition

I have a question which is slightly programming related, but it mostly relates to how ext4 works. I have a program which writes 128MB to a file with changing random aligned offsets. I write 256KB ...
12
votes
1answer
6k views

When can I edit strings in an executable binary?

I have an executable binary; let's call it a.out. I can see the binary contains strings $ strings a.out ... /usr/share/foo .... I need to change the string /usr/share/foo to /usr/share/bar. Can I ...
-1
votes
1answer
8k views

how to return file descriptor in c [closed]

I am confusing with this. fp=fopen(filename,mode); what is the value fopen() return to fp. is that value is file descriptor integer? is fp called as stream ? if not how to return a ...
0
votes
2answers
98 views

What operating systems do experienced users use and why? [closed]

I was reading the Modern Operating Systems book and it says Many UNIX users, especially experienced programmers, prefer a command- based interface to a GUI, so nearly all UNIX systems support a ...
0
votes
1answer
551 views

How to use programs with MPI?

Is it possible to use programs with MPI for example blender? Is it a mpi program by only adding the source file "mpi.h" or is there any way to simply convert an existing program for the use with mpi? ...
2
votes
1answer
381 views

m4 macro using variable number of tabs to line up a column

This is the macro I have so far: define(`debug_macro', ` #ifndef $1_DEBUG #define $1_DEBUG'forloop(`i',`1',eval(5-(len($1)/4+ifelse(eval(len($1)%4 == 0)), `0', `1')),` ')dnl`0 #endif ') The goal ...
2
votes
0answers
617 views

How to determine the wordsize in Linux kernel programming? [closed]

In userspace code, the macro __WORDSIZE is used, included in <bits/wordsize.h>. However, when I do Linux kernel programming, the __WORDSIZE seems not available. If <bits/wordsize.h> is ...
1
vote
1answer
127 views

On shutdown, do un-mounting drives happen before shutdown signal handling?

So based on my understanding of the Unix/Linux shutdown process (which is highly limited I admit), I think at some point these steps happen: 1. mounted drives get unmounted 2. a termination signal ...
2
votes
2answers
2k views

How to update CodeBlocks in Kali Linux?

I installed CodeBlocks on Kali Linux but I got 10.05 version and I want to update it to 13.12, preferably via terminal. Also I would like to know how to update any application this way.
0
votes
1answer
2k views

NetBeans : Can't build Java project

I installed today on my old developer PC NetBeans (the newest) and I cloned my repo from BitBucket (I began coding with NetBeans on Windows 7). I tried to make a clean build, but the compiler has ...
10
votes
1answer
11k views

What does Unix programming mean, exactly? [closed]

I thought I understood what the term Unix programming meant, but now, after reading about it in a kernel/C programming context, I feel like I need to clarify the meaning of this term. It is not clear ...
0
votes
4answers
2k views

Compiling C/C++ code by way of including preprocessor build instructions in an actual C/C++ source file

I've got reasons for not wanting to rely on a specific build system. I don't mean to dis anybody's favorite, but I really just want to stick to what comes with the compiler. In this case, GCC. ...
2
votes
1answer
972 views

VT100 terminal emulation to use with a Java-based 8-bit computer emulator

I'm successfully using GNU Screen as serial terminal to "talk" to my Altair 8800 clone (http://altairclone.com/) using serial line. The command I use is: screen -istrip /dev/ttyUSB0 Screen does the ...
1
vote
1answer
1k views

Bash loop new user

I have to create 20 users on 10 servers. I want to create a script that will create 20 users for me on the server (that's easy with useradd) and encrypt the password. I have my variable $crypt=perl -...
3
votes
2answers
663 views

Is there an equivalent book/resource to “The Linux Programming Interface” for FreeBSD? [closed]

Most of you here are probably aware of the famous The Linux Programming Interface, which presents a truly masterful guide to the Linux and general POSIX APIs. I know that much of the general POSIX ...