Questions tagged as 'unix'

4
answers

How to deal with a kite process?

Analyzing the linux API I noticed that an interesting structure is possible: #include <unistd.h> #include <stdlib.h> int main() { while (1) { if (fork()) exit(0); // Altera meu pid setpgid(0, 0); // Cria um...
asked by 31.01.2014 / 15:54
2
answers

What is shebang? [duplicate]

Since in many languages the # character represents a comet, what's the point of using it? Does it have any special meaning?     
asked by 17.03.2017 / 19:07
1
answer

Play music in C program

I need to run a song while running a program in C. In Windows we can do this - if the file is in the same program directory: #include<stdio.h> #include<stdlib.h> int main (){ system("start music.mp3"); return 0; } The file...
asked by 14.12.2015 / 00:04
2
answers

Why do I need './' to run commands on Unix?

I noticed that every executable that I need I need by a ./ to run it on both Linux and MacOS (Unix / Unix-like systems). For example, to compile a C file with GCC and run it right away, I make the following commands: $ gcc fonte.c $ ./a...
asked by 30.06.2017 / 11:48
2
answers

Optimization and advanced compression of images on web servers without the use of external services

How to make compression even more optimized than can be achieved with tools such as ImageMagick and libgd (GD) without generating WEBP image? Some services, such as link and link promise to optimize image without loss of qua...
asked by 05.06.2015 / 06:07
2
answers

What is the difference between a symbolic link and a hard link?

In the Unix context, what is the difference between a symbolic link and a hard link and which commands are used to create them?     
asked by 11.06.2015 / 17:53
2
answers

Script to find and replace words in multiple files

I need to make a command that finds and replace a directory path with another path, in several HTML files, example of part of the HTML file: <DIV STYLE="margin-top:6pt;margin-left:36pt;" >< FONT ID="f16" > <A HREF="file:/export1...
asked by 15.12.2014 / 17:07
2
answers

Find and Replace Various Word Within a File

I want to develop a script that will replace any words in file . I know what I can do with the command (s) below: $ tr 'ABC' '123' < arquivo.txt > novo-arquivo.txt or $ sed "s/ABC/123/g" arquivo.txt > novo-...
asked by 05.10.2016 / 06:48
2
answers

Delete character in a certain position?

How do I delete a particular character in a particular position in the shell? I've tried with sed , but I can not put the position too, just the default. ",45123","B23142DHAS675" What I wanted was to delete the , that is in...
asked by 30.04.2014 / 21:24
1
answer

Problem with 'echo -e'

I'm starting to learn shell script and am doing some simple scripts to train. The script below tests whether anyone running the script is logged in as root. # !/bin/bash # # This script test if you are the superuser if [ "$(id -u)" = "0" ];...
asked by 14.08.2014 / 01:45