Questions tagged as 'shell'

2
answers

Write text in Shell Script

I'm doing a Shell Script, and I have to write a lot of lines in a single file, how can I do it in a more automatic way? Well I started doing it in a very manual way: echo "primeira linha do arquivo" >> /diretorio/arquivo.txt echo "segund...
asked by 27.11.2018 / 00:18
1
answer

shell_exec php with accent

I need to run a command via shell which may have an accent (involves filename) by PHP. Printing the command and running it in hand it runs with the accent, but with shell_exec it does not run. If I take the accent from the file name it...
asked by 13.09.2018 / 20:46
1
answer

Unix Grep command handling the output if there is no result

Good morning !! I'm creating a script and I need when I make a grep on a line and can not find it, it returns the parameter I looked for! grep "192.0.0.1" /file.txt In the .txt file it does not have the string "192.0.0.1" I want it to retu...
asked by 12.02.2018 / 14:39
1
answer

Run the shell_exec command with UTF-8 in PHP

I'm developing a system in PHP language and use the command shell_exec , but when I return some message with accent, it does not show the character. Example: Command: <?=shell_exec('tasklist /fi "pid eq '.getmypid().'" ')?>...
asked by 10.04.2018 / 02:23
2
answers

Replace "[" with [using thirst

I'm trying to correct some formatting errors in a file and I have as input: "[""teste""]" And I wanted to get an output like this: ["teste"] I already tried this command but it gives me error: sed -i s/"["/[/g *.csv sed -i s/"]"/]/g...
asked by 25.10.2017 / 18:59
1
answer

How to show only lines that appear more than x times. (shell script)

I am parsing a log file and I wanted to filter only lines that appear more than 10 times within the file. I just can not find a way to do this filter.     
asked by 22.11.2017 / 14:41
2
answers

Shell / Bash - Script continues before finishing the line that is running

I have a shell / bash script that works perfectly for making backups, the problem is that I have large files that are giving problems in running the script. The script has to compress the file in tar.gz format and it does this, but when i...
asked by 09.08.2016 / 20:03
2
answers

Failed to execute Shell C #

Friends, I ask for help to solve a small problem. I'm running SQL command through sqlCmd and Shell in C #, but the file is in a folder that contains "space" as follows. Path: D: \ Sandboxes \ CIA Project \ 3-Development \ Scripts \ DDL \...
asked by 15.07.2015 / 17:45
1
answer

Installing web environment with shell script

The shell script below performs some simple tasks for me, however, I would like to make the code a bit more elegant: #!/bin/bash echo "#######################" echo "Preparando servidor web" echo "#######################" verificar() { i...
asked by 01.08.2017 / 06:46
1
answer

How to use \ t (tab) on outputs with EOF?

See the example below: cat << EOF alias\tVARIABLE = command EOF The run output does not take into account the regex \t .     
asked by 23.12.2018 / 02:36