Skip to content
Advertisement

NASM code with user output, and then input into an argument. (code error)

I have had problems implementing user output into and argument with my below code.

An example of BASH showing, a similar example function of what i would like to implement in NASM.

JavaScript

The reason why I am creating this code is to show a comparison of different languages, used within Linux, This is one part of my research project. So i know, this can be done in other languages e.g. Python BASH and C etc. Before anyone asks.

I believe I’m somewhere on the right lines, here is the code below.

JavaScript

The error is:

JavaScript

This error was fixed using dd but It will not add the user group to the system.

The below code works to show all users but will not take user input as the argument. This is an example of working command code but without user input. So how would one implement user input, with the command line code.

JavaScript

Advertisement

Answer

Here is a fixed version. Note that groupadd might not be in /bin, and you should probably print an error message if exec fails.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement