Questions Tagged [Bash]

Questions Tagged [Bash]

This tag is for questions about scripts written for the Bash command shell. For shell scripts with syntax or other errors, please check them at before posting here. Questions about interactive use of Bash are more likely to be on-topic on Super User than on Stack Overflow.

146,195 questions
0 votes
2 answers
17 views

Bash script works with all arguments except one

I'm on OSX, and I need a bash script that handles multiple arguments. Based on some answers on this website, I wrote the following bash script (some strings have been removed for privacy): #!/bin/bash ...
  • 4,353
0 votes
0 answers
14 views

crontab not being executed into a container after setting up permissions

I'm running a docker container with an image: ubi8/ubi-minimal The cronjob has correct path and go packet is already installed: crontab -l */2 * * * * go run /usr/local/src/script.go The file has ...
  • 163
1 vote
1 answer
20 views

Are integers in Bash signed by default?

I suspect that, by default, integers in Bash are always signed unless they exceed a specific positive value that cannot be represented in two's complement notation. Is that so? Is it documented? I ...
0 votes
0 answers
8 views

How to run Windows executables from a cronjob via a shell (bash) script in WSL 2?

I'm running Windows 10 x64 with WSL2 (Ubuntu 20.04 on WSL2). In WSL2, I have cron running the following task: * * * * * /mnt/c/Users/Colin/Desktop/test.sh The contents of test.sh (currently executing ...
0 votes
0 answers
22 views

shell script to create text using data

I have one file that contains data like this User= yojpackco Domains=yojpack.com User= yugmaimpre Domains=yugmaimpressions.com User= yvmarathej Domains=yvmarathejewellers.com User= zawargauge ...
-1 votes
0 answers
12 views

How Can I Open The Content of a Webpage Whose output was re-directed to a tmp.html File within my directory on my Terminal

I would like to apologise if the question is confusing but here is what I would like to achieve... I'm trying to scrape some information from a webpage so I created a file called tmp.html so as to ...
0 votes
1 answer
16 views

"head" equivalent in detached head state

Lets say I'm in a detached head state and I run the following command: git push origin head:something/something/blah git will output the following error: So my question is: What is the correct ...
  • 511
0 votes
1 answer
31 views

bash how to change name of the file before moving

I wrote bash script to export logs from my linux machine to S3. What I want is to add the ip address of the instance to them name of .gz file I am moving and I don't know how to do it. Here is my ...
  • 57
-2 votes
0 answers
10 views

Pass the parameter "-n" to the shell script and then use for in to traverse -n without output

《-n where to go》 Pass the parameter "-n" to the shell script and then use for in to traverse -n without output enter image description here
1 vote
1 answer
18 views

Bash loop on files in folder without specific pattern

I have to cycle over the files present in a folder but I dont want to cycle over files with a specific pattern ("Reverse"). Here is the code Thanks DIRECTORY=/Users/
0 votes
0 answers
9 views

git throws error : "eval is not recognized windows", what should I do

So eval command is not recognized in windows visual studio code, even though I'm using bash in terminal
1 vote
0 answers
14 views

Vim formatted print date to current file

I am trying to print the current formatted as Mon, 1 Jan 2022 into my current file in vim. So far I've tried the following command, but the % sign gets put into the command as the current file. :0r !...
-3 votes
1 answer
30 views

Programming environment? [closed]

I'm trying to add color to a part of my Ubuntu bash prompt. This part isn't working: (\e[0;31m\1\e[m) It works, however, if I place it within the PS1 export. What am I doing wrong? show_git_branch() { ...
  • 515
0 votes
0 answers
9 views

bash: poetry: command not found

Goal: Get Poetry working in my Anaconda3 venvs. I'm using Anaconda3, via. Git Bash in PyCharm. I installed Poetry using: conda install -c conda-forge poetry Location: C:\Users\dabell\Anaconda3\Lib\...
0 votes
1 answer
13 views

How to show indication for bash script commands execution using exec in php?

I have a bash script file "myApp.sh" that include many commands (for loops, building DB, import data to DB, calling other bash scripts files). The commands are complicated. I am invoking ...

15 30 50 per page
1
2 3 4 5
…
9747
James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.