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 https://shellcheck.net before posting here. Questions about interactive use of Bash are more likely to be on-topic on Super User than on Stack Overflow.

0 votes
0 answers
12 views

How to accomodate single quotes in sed bash [duplicate]

define.php define('TEST_FLAG1', false); define("TEST_FLAG2", false); In the above php file (define.php), I need to replace the value of 'TEST_FLAG1' (in single quotes) with boolean value ...
user avatar
0 votes
0 answers
9 views

How to get the list of files in a repository that have not been updated/changed in the last 6 months

I want to create a report which will contain the name & location of files that have not been updated/changed in the last 6 months. I am thinking of writing a script to achieve the report that ...
user avatar
-1 votes
2 answers
14 views

How to create a parent directory with multiple subdirectories which has nested subdirectories within the respective subdirectories

I'm new to shell scripting. I'm trying to create a main folder called Analysis. In the Analysis folder I would like four sub-folders named, PhenV1, PhenV2, HypV1, and HypV2. I then want to have each ...
user avatar
0 votes
1 answer
13 views

How to write a bash script that runs a customized program?

Here is an example for my customized program which is executed as: ./TestVariance.exe 2 100 10 .9 I want to write a bash script that runs it several times while changing the second argument each time....
user avatar
0 votes
0 answers
15 views

End of the Month file not running the last day certain months

We have a shell scripts which gets triggered via cron on the last day of each month, on certain months the script fails to run. My attempt is to figure out where the issue may possibly lie. The ...
user avatar
0 votes
0 answers
15 views

Bash script - Is there a way to read what is being logged in console?

I'm using a web API and when it crashes I have to manually restart it by clearing the current command and then typing 'npm start' into the console. To save myself some trouble I tried writing a bash ...
user avatar
0 votes
0 answers
19 views

Place command resulted by a git alias to bash history

The following git alias give a menu to select the remote and branch name for fetch command. git config --global alias.fh '!git fetch $(git remote | rofi -dmenu) $(git branch | sd "^[\*]*[ ]*"...
user avatar
  • 8,981
0 votes
1 answer
24 views

Permission denied to run shell script by subprocess.call

I wrote a shell script using python and it successfully run by command bash download_R1.sh on my terminal. I wanted to test if subprocess can do the same thing in python because I would like to ...
user avatar
  • 3
0 votes
0 answers
22 views

Why a path to a file retrieved from an external file with tail, doesn't work as argument for a program launched from a bash script

This is the last line I retrieve with tail from a file named ./config2.cfg located in the same directory as my bash script: LastUsedROM = /media/user1/MIYOO/Roms/MD/Golden Axe II (World).zip And this ...
user avatar
0 votes
0 answers
23 views

Replace String present in double quotes in unix shell script

I have input like below <tag Start = "" col = "" > <Data> </tag end> <tag1 = "" col1 = "" col2 = "" > Here tag1 can have some ...
user avatar
0 votes
1 answer
17 views

How to stop echoing on terminal while script is in loop

I made a script which has allot of loops hence it has short timedelay to Output results. but while the script is in loop, whenever i enter any key on my keyboard it just mess the beauty of Outputs. A ...
user avatar
0 votes
0 answers
19 views

How to run bash script when certain type of file is clicked in linux

I am having trouble with osz file which is open by osu! but that is not working so when When I click *.osz file i want to run a script that copy that file to another location how to do that.
user avatar
0 votes
0 answers
28 views

Shell script to scan files in S3 and output results into log file

I am very new to bash and shell scripting and would like to write a script that 1) scans an S3 folder and grabs the names of every file sitting in an S3 folder; 2) scans each file and grabs the column ...
user avatar
-1 votes
1 answer
36 views

Why am i getting an error near the if statement here? [duplicate]

for i in {1..10} if [ $i=5 ] then echo "Youve completed 5 iterations, do you wish to continue?" read input if [$input ="Yes"] then continue else ...
user avatar
0 votes
1 answer
27 views

Easiest way to parse command line string to subprocess list?

I'm trying to figure out how to run this command using subprocess.run(): cmd = 'find / \( -path /mnt -prune -o -path /dev -prune -o -path /proc -prune -o -path /sys -prune \) -o ! -type l -type f -or -...
user avatar

15 30 50 per page
1
2 3 4 5
9775