Questions tagged as 'shell'

1
answer

Creating my "mini shell" - Error: Segmentation Fault

I am developing a mini shell for a university practice and I run into an error that I have not been able to solve since according to what I have understood, searching in Google for my error, it is an error that can come out of several causes. Le...
asked by 09.11.2016 / 14:50
1
answer

How to perform date conversion YYYY-mm-dd in bash

How can I get the format of a specific date? I have the following date: 18APR01 but that format I do not want, The code that I have is the following: date --date=18APR01 +%Y-%m-%d Exit: 2001-04-18 What I really want is for the out...
asked by 19.10.2018 / 23:00
3
answers

How to use for cycle in bash script?

I have a little bash script that does not work the way I want to Here is the code #! /bin/bash echo "Escriba la cantidad de letras" read x for i in $x;do echo "Letra $i" read y echo $y done #export Mensaje #./recibir.sh Image of the log...
asked by 10.11.2016 / 21:45
4
answers

Error starting httpd in centOS 7

I get an error when starting httpd in centOS 7. I tried restarting with systemctl restart httpd.service and also systemctl start httpd.service and I keep getting the same error, I've done it as root. It is worth mentioning that previo...
asked by 01.06.2016 / 05:29
1
answer

How to generate output with colors from shell script bash to file and maintain the colors?

I'm developing a utility in a bash shell script (file.sh), I can generate colors when the output goes to console, for example with a code like: echo -e "\e[1;33m Aqui el mensaje \e[0m"; But my idea is to create a log file as identical as po...
asked by 29.10.2018 / 18:27
1
answer

How can you increase dates in a shell?

Description: I need to take a date in dd / mm / yyyy format and increase the day. For example, having a date 01/01/2017 , the idea is to have the following output: 02/01/2017 Code: I am trying with date -d "${fecha_ultim...
asked by 06.01.2017 / 21:29
1
answer

Get shell variable from C

This is the code I was testing, but for some reason the output I get is nothing. #include <stdio.h> #include <stdlib.h> int main (int argc,char*argv[], char *envp[]){ FILE *fp; char path[1035]; fp=popen("/bin/echo ${CO...
asked by 28.04.2017 / 19:31
1
answer

Operate with powers of decimals in shell

I'm trying to make a shell script that takes numeric data that are usually decimal of type 0.00004 and I have to square them. Using "bc" the result I get 0. Example: echo "(0.0000003+0.0000005)^2"|bc 0 Looking at the help of bc, he says...
asked by 06.04.2018 / 22:57
1
answer

get return from a shellscript dialog?

I'm trying to create a script .sh to capture the action of a dialog on Mac that shows the buttons No and Si , and then execute code depending on the answer, I have not managed to make it take the actions of the user. This...
asked by 15.09.2017 / 20:28
1
answer

Detect executables in bash [closed]

I am new in the bash language (GNU / linux) and a question has arisen in an exercise: I have to go through all the files in a directory, and for those that are executable, I save a variable 1, or a 0 in case of not being executable. I tried t...
asked by 31.03.2017 / 21:35