Most voted "bash" questions
Bash is a very popular shell (command interpreter). Using the commands provided by Bash itself (built-in Commands) we can perform a series of operations in sequence or create quite complex scripts/programs.
Learn more…291 questions
Sort by count of
-
0
votes2
answers130
viewsHow can I turn " to " in a bash script
I made a small script in Python that transformed a file .py in a Linux bash script, however, the quotes that are inside the Python file end up making the script not work. Is there any way I can turn…
-
0
votes1
answer66
viewsRun Artisan within linux shell script
How do I shell a linux script to run an Artisan command from Laravel? ex: php artisan migrate but create a script to run this command
-
0
votes1
answer118
viewscat file.txt VS. cat < file.txt
Personal hail, I recently started studying bash Unix and I have a doubt that I can not resolve regarding the command "cat". During the course of Code Academy, it presents the code in two moments:…
-
0
votes1
answer69
viewsResult of a command in a variable
When I run the following code it stores the output status of the command wc -l which has value 0 as it has been successfully executed. #include <stdio.h> #include <stdlib.h> int main() {…
-
0
votes0
answers46
viewsBash file filter
I am wanting to print specific columns of a file. My file is like this: random random kB reclen write rewrite read reread read write 10240 4096 35383 32281 58250 130504 100674 38425 Has more…
bashasked 5 years, 7 months ago Rafael Breno 33 -
0
votes0
answers29
viewsmkvextract giving error in windows
I installed the MKVToolNix on my computer and put the folder in the environment variables. When using the MKVExtrac in the Arquivo.sh, it presents the following error: What could be causing this…
-
0
votes1
answer27
viewshorizontal scrolling bash window (turn off line wrapping)
I’ve searched all the forums, and in Bing/google until tired, I didn’t find anything, probably by manezice, is it possible to put a horizontal scroll bar in window bash? I saw in some places that…
-
0
votes1
answer45
viewsGNU Parallel - Using File with Variable Data within a Script
I would like some help with GNU Parallel. Is it possible to read variables from a file and pass these variables into a bash script via Parallel? For example: I have a file called dados.txt…
-
0
votes1
answer1188
viewsHow to leave a single version of Python on Linux/Ubuntu?
I even understand the fact that there is Python2.7, which in itself is quite annoying because every time I lower the modules to the wrong place, but when I tried to upgrade the version 3.6 to 3.7…
-
0
votes2
answers100
viewsIdentify the amount and value of arguments received in a script
How to identify the amount of arguments I received in a Bash script? How can I get past values?
-
0
votes1
answer262
viewsCommand to open the terminal in a specified folder
I am producing some scripts to prepare the desktop, and wanted to leave the terminal in a predefined folder. How to do this? I’ve tried using cd ./pasta_selecionada and cd pasta_selecionada, but…
-
0
votes2
answers42
viewsRename new files without interfering with old ones
I need to rename some files .srt, but if I do it in the current way it will impact the old files. I have several subtitle files that I’ve already edited for pt-BR.srt, but with the addition of new…
-
0
votes1
answer64
viewsLinux - incorrect result with find and xargs command
I’m trying to list the files of the last day, but through the command below it lists the files of the last day and then starts to list all the files: [oracle@orcl11 adump]$ find . -ctime -1 | xargs…
-
0
votes1
answer95
viewsrun python file list with shell script
My code: #!/bin/bash scriptspy =( '/scs/sp1.py', '/scs/sp2.py', '/scs/sp3.py', '/scs/sp4.py', '/scs/spweb.py', '/scs/sp11.py', '/scs/spservice.py', .... ) for i in scriptspy; do python3.7 $i; done…
-
0
votes1
answer414
viewsCommand not found bash
I am encountered the following error while running this script: line 7: [1: command not found #!/bin/bash #$ for counter in $(seq 1 255); do curl -X POST -H 'Content-Type: application/json'…
-
0
votes1
answer44
viewsString set for a for loop using pipe (shell script)
I’m trying to write a shell script that processes some strings and passes them all by pipe to a for loop, but I’m having trouble getting the iterator through those strings, because I thought that…
-
0
votes1
answer26
viewsMake Shellscript act as pipLine
How can I get my script to act in a pipeline example: ls|./meuScript|grep 'Mensagem Qualquer' what './meuScript' has to have to act as a filter ?
-
0
votes1
answer118
viewsIs there any way to run the bash script in windows?
I have a BASH script that is used on LINUX and I need to run it on Windows 10. Is there any way to run correctly without error? directory_exist.sh #!/bin/bash echo "Informe o nome do Diretório" read…
bashasked 4 years, 2 months ago Mauro Rocha 114 -
0
votes2
answers126
viewsFormat file . csv in bash
I have the following problem: I copied the data from an Internet table into a text file. The goal is to turn this file to the default. csv in English (comma separated and decimal separator being the…
-
0
votes1
answer199
viewsProblem with variables that receive content from a shell command
I have a problem in a shell script I’m using for a test for a future task. The script is simple... I have a text file that has 2 columns with the delimiter ";". In the first column there are…
-
0
votes2
answers63
viewsHow to get only a chunk of a command output
How do I show only the version number? Example: GIT_VERSION=$(git --version) echo $'git instalado com sucesso! Na versao: '$GIT_VERSION$'\n' The output I wish is "In version: 1.20.2". I have tried…
-
0
votes1
answer90
viewsError "mkdir: Missing operand"
I am trying to create a series of folders on my computer that start with strings from "01" to "20". To do this, I created a list of strings and applied the command mkdir in an iteration: declare -a…
-
0
votes1
answer15
viewsHow to "Take" the value of the COMPOSER_PROCESS_TIMEOUT variable?
I’m using a script bash to define the variable COMPOSER_PROCESS_TIMEOUT, but before I change the value of it I need to know what is the value that is defined. I took a good look on the internet and…
-
0
votes2
answers141
viewsHow to group substrings in condition and return them with BASH_REMATCH
I need to split a file-named string, in 5 parts, as an example below: #!/usr/bin/env bash str="python-zope-proxy-4.3.5-1-x86_64.chi.zst" pkg_re='(.+)-[^-]+-[0-9]+-([^.]+)\.chi.zst*' [[ $str =~…
-
0
votes0
answers282
viewsVisual studio code terminal is not working properly
Hello, my vs code is having a problem where the terminal simply isn’t showing the username with the command line. as you can see in the image below appears only this screen where it is not possible…
-
0
votes1
answer26
viewsHow to search within a file in different subfolders using grep?
How can I make a grep searching in a specific file but within several subfolders? Something like grep -R "busca" /home/apps/*/teste.php The asterisk is the indication that I want to search in all…
-
0
votes0
answers23
viewsWith undoing the delimiter effect on the cut command?
Good morning, everyone. I am using a component in my work, which receives a csv to parameterize data ingestion between sql server and Hive (Hadoop). I can only authenticate to sql server if you…
-
-1
votes1
answer62
viewsCapture Linux logon event using Java
Hello, I would like a help to create a class that captures a user’s login event on Linux using Java.
-
-1
votes1
answer71
viewsBash alias to create runtime script
I want to create an alias to make an executable script, already tried to add to .bash_aliases and to the .bashrc commando: alias mksh='touch $1 && chmod +x $1'…
-
-1
votes1
answer74
viewsRedirect google Chrome to localhost when offline
I have a system on top of a Raspberry that needs to work online. A Raspberry that opens directly a page on Chromium. What I’m trying to do is this scprit I did. #!/bin/bash wget -q --spider…
-
-1
votes0
answers11
viewsHow to ensure sudo permission to a build script from gitlab ci/cd
I’m writing a script for gitlab ci/cd, to compile and run some tests. I need to download some packages like python, pip, cpython etc... for this I am using the CentOS, yum, however the gitlab user…
-
-1
votes1
answer25
viewsFile output with YAD
Good morning, everyone, I have some problems with the use of YAD. I have a super functional and very useful shellscript. Now I’m trying to put it in a graphical interface to look really nice and…
-
-2
votes2
answers128
viewsTimer for a shell script command
Good afternoon, everyone, I want to write a script with a command that captures all wireless network flow around my company and store it in a text file. Currently I do so: airmon-ng start 'nome da…
-
-2
votes1
answer36
viewsBash - current date and calendar with "if Else"
#!/bin/bash echo "1 - calendario" echo "2 - data" echo "opção: " read var if [$var -eq 1]; then calendario=$(cal) echo $calendario elif [$var -eq 2]; then now=$(date) echo $now else echo "opção…
-
-2
votes1
answer18
viewsClear bash history on Kali Linux
The searches I did on clearing the bash history were useless. I used history -c, but the terminal did not accept an option -c, nor -w. I tried to delete the file /.bash_history, but there is no file…
-
-2
votes1
answer91
viewshow to remove unnecessary commas using sed in the shell script?
I’m trying to create a script to automate a job I do. Everything was going well until I found this problem. When I use the sed, to remove a word from the string, the output shows 2 commas together,…
-
-2
votes1
answer66
viewsGuys, I need to create a shell script code to discover the MTU of the local network with a loop
I’ll send the assignment. Objective: to identify the value of the MTU used in the TCP/IP network local, dynamically and with some heuristic to, in this way, minimize the number of iterations in…
-
-2
votes0
answers12
viewsError placing my code on github
I started recently in programming, created a calculator and wanted to put my code on github. For this, I saw a video on Youtube. However, in the last step, when I push is not working, the following…
-
-3
votes0
answers37
viewsAm I the victim of some hacker?
Hello, I’m beginner in the world of technology and I’m suspicious of some files that appeared on my Home on Ubuntu. That’s because I haven’t seen these files before. It’s them…
-
-3
votes0
answers21
viewsShell Script: how to log into a php web application using Curl?
Good morning guys, I’m new here... actually, I just made this account for a specific question, because I didn’t find anything relevant to solve my problem. Anyway; I am trying to log into a php web…
-
-4
votes1
answer36
viewsShell script error while renaming a large set of folders
People were making a script to rename several folders in bulk that contains tabs+spaces+dots+dashes and many other characters in the name for something like: name_myname_folder. I made a script…