Bash is a free shell for Unix-like operating systems from the GNU Project.

learn more… | top users | synonyms

0
votes
0answers
4 views

GPG Agent under Windows as SSH Agent for git bash

I'm trying to set up gpg-agent as the common authentication agent under Windows. It works fine for both Putty and regular gpg use, but now I'd like to use it as ssh-agent in git bash as well. From ...
0
votes
2answers
17 views

tar: How to remove files after packing but keep directory

I want tar to pack a complete directory tar cvjf dir.tbz dir But make it delete all files tar cvjf dir.tbz dir --remove-files However this removes ./dir too. So I tried to cd into directory ...
2
votes
1answer
23 views

Linux: Finding Processes I Started To Kill Them

I am programmatically starting several servers in Gnome terminal with each server in its own titled tab: gnome-terminal \ --tab -t "Server1" -e 'bash -c "export ...
0
votes
1answer
29 views

BASH : grep count same word occurrence

Is it possible to count the maximum number of occurrences of a word in a string using only grep ? Here is an example of what I want : script.sh "aaaa bbbb ccc bbbb azesd bbbb" would return bbbb ...
0
votes
1answer
42 views

Bash quotes unescaped on command substitution

Can someone explain me why this is working (listing the contents of a directory that has a whitespace in its name): ret="$(ls "my dir")" Shouldn't it rather be interpreted as: ret="$(ls " my dir ...
1
vote
2answers
19 views

How do I remove the extra bash-3.2$ from shell-mode?

Summary The first line of shell-mode has an extra bash-3.2$ prompt before my custom dotfiles (master)$ prompt. I tried writing PROMPT_COMMAND='' in my ~/.bashrc according to an earlier Stack ...
0
votes
1answer
15 views

Recursive rename files and folders

I need to rename every subfolder of a specified path. For example I have a directory structure like this: project/ /x /something /somethingElse /x ...
0
votes
1answer
19 views

Linux Bash Script File Search for Log File

How would I go about writing a Linux bash script for the following? I need to search for a file of format [unique_number].log This file would exist within one of the following directories ...
0
votes
2answers
17 views

grep and sed with pipe from tail -f appears to be caching

I am trying to get a working system to monitor special logs. I usually just want a very specific pattern which I extract using grep and a pipe from tail -f. I have noticed that grep does not output ...
-2
votes
0answers
9 views

neebie . get a bash file that can be run and seen on a html.pnp page

I have a bash file, that when run from putty works and makes a connection to my media server and copies the username and password to a file. Is there a way for this to be able to be run from a php or ...
0
votes
1answer
17 views

Run .sh in cygwin script from cmd

I have a .bat script that calls some .exe to generate text files: generate.bat: ... ResGen main.txt Main.resources /str:c# ... After that, I want to use vim's commandline search/replace on the ...
1
vote
1answer
23 views

bash behavior on sigterm

Have a script as below: #!/bin/bash # # run this script. don't run it if it's already running. # PIDFILE=/tmp/script.pid LOGFILE=script.log if [[ -f $PIDFILE ]]; then echo "$PIDFILE exists. ...
0
votes
1answer
18 views

bash script to call two functions, consecutively, each with its own argument

There are a lot of similar questions, but I cannot find an example of what I am looking for, nor in the Bash scripting guides (I'm sure it's there but its a big book...) What I want is this: I have ...
0
votes
2answers
32 views

In a Terminal profile, how can I set it to cd right after ssh connects?

I'm on OS X, using Terminal (bash) to connect to my web server. I'd like to set up the Profile so that it opens to a specific subdirectory after ssh connects.I don't always want to start in this ...
0
votes
1answer
21 views

Insert sound into an mp3 track

I'm looking for a way to insert a custom sound at a given second into an MP3 track. I'd like to be able to do this without GUI tools so I can invoke it from a bash script, and I'd like this sound to ...
1
vote
1answer
18 views

how to insert text at the beginning of each paragraph in bash

I have a file with multiple paragraphs separated by blank line. Technically they are not paragraphs just sections of text separated by blank line. I want to number the paragraphs so to speak by ...
1
vote
1answer
18 views

.zshrc doesn't export variable for anaconda

I installed Anaconda Python on my Mac today and following line was added to .bash_profile by Anaconda. Since I am using zsh so I moved this line to .zshrc. However, it doesn't work properly even if I ...
0
votes
0answers
14 views

don't save big commands in .bash_history

How to prevent saving commands that consist of more than 2 lines in .bash_history? I tried: HISTIGNORE='* * *' but commands such as: cat <<'EOF' a b c EOF are saved.
3
votes
2answers
42 views

Why does bash need && to echo a variable on one line?

Why does SOMETHING=1 && echo $SOMETHING need && to return 1 Why doesn't SOMETHING=1 echo $SOMETHING return 1
0
votes
0answers
7 views

Zip epub using 7zip and issue with exlude file

I've many epub as folders need to convert it to .epub compressed so i created bash script to that ..which are compress the epub folder to zip then rename it to .epub using 7-zip btw i was try to use ...
0
votes
2answers
28 views

Why am I getting mv errors with this sed command?

Given the following directory: [~/test]find . . ./something_else.txt ./univision.rbw ./something_else.rb ./testtest ./testtest/weewee.rb ./testtest/weewee.txt ./univision.rb Running the following ...
0
votes
0answers
11 views

Bash history deduplication causing dangerous multi-shell behaviour

I am using the following code in my .bash_profile to filter and de-duplicate my bash history: shopt -s histappend HISTSIZE=100000 HISTFILESIZE=100000 HISTCONTROL=ignoredups:erasedups ...
0
votes
0answers
16 views

ICMP flood with ping working only one time

my problem is simple: The first time I made a flooding ping to a fake ip on my network (for testing if someone is on promisc mode), it works perfectly: $ping -f 192.168.1.10 After perfoming this, ...
0
votes
1answer
27 views

How to stop tail -f except using kill

I want to write a shell script to detect if my program starts up successfully. There is a log file created by the program. When the log file contains a new line: Server startup in, then stop the bash ...
3
votes
2answers
31 views

Command Line Sort Files or Directories by part of their name

How do I sort files or directories by part of their name, specifically the element contained in the parenthesis or separated by delimiter? I am after two separate solutions one for directories with ...
0
votes
1answer
23 views

Python logging class not working when sending stdout to /dev/null

I have a Python 3 script that has logging enabled (for debugging purposes). Whenever I run/execute this script it is working fine and the logfiles are created. I've also created a setup.sh-bash ...
1
vote
1answer
20 views

Grep with string comparison: return only lines “higher than” a timestamp

I have an email log file which records when an email went out, and who to. This gets logrotated and so there are a mixture of zipped and unzipped log files going back a week or so. I'm currently ...
1
vote
2answers
57 views

Convert all files in directory using FFMPEG

I'm trying to write a script to convert all the files in a directory to m4v, whilst trying to keep similar (if not the same) quality and compress the file to reduce the overall size. I've pieced ...
0
votes
0answers
11 views

Scrolling in tmux over SSH (PuTTY) [duplicate]

I'm SSH'ing into my RaspPi (Raspbian) with PuTTY and I want to user tmux in order not to worry about a connection ending while I'm installing something. My Problem is, that when I call tmux from a ...
1
vote
1answer
35 views

Installing GNU Parallel on Cygwin [closed]

Is this possible? I have googled and searched at length and found no answer to this question. How can I install GNU Parallel on Cygwin? I wish to run a command similar to this : Link Thanks.
1
vote
0answers
19 views

Stop automatic comments in my crontab

I have added the bellow cron jobs in my crontab : 0 5 * * * /bin/systemctl restart gb_subagent.service 28 13 * * * /home/comment.sh &>/tmp/errorcron.log 29 13 * * * bash ...
2
votes
1answer
27 views

Print line for word found in file in directory

Hello i am using this line find ./ -iname *txt | xargs grep "ququ" -sl>holis.txt To find "ququ" text in a txt file and then write the file name that does contain such word in the txt file, ...
0
votes
1answer
31 views

Look word inside file in directory

I am new at Bash. I have a directory tags with a lot of .txt files with similar names like this [coral/home/tags]$ ls: file1.txt file2.txt file3.txt file4.txt Each .txt file contains information ...
1
vote
3answers
44 views

How To Quickly Switch Paths (in Bash)

Sometimes, usually when installing packages with brew, I want to disable/remove certain parts of my path, and then later restore them. I haven't been able to find an easy way to do this, and while I ...
0
votes
2answers
24 views

Mac OS .bash_profile errors

I'm running Mavericks 10.9.5 and I have tried to install Metasploit from this guide. It was until the Install Homebew I used echo PATH=/usr/local/bin:/usr/local/sbin:$PATH >> ~/.bash_profile ...
3
votes
2answers
67 views

Linux's write command issue

I'm trying to send a message to myself through write command because I want some scripts running in the background and being able to echo things to the terminal where I am. So, I get always the same ...
1
vote
1answer
22 views

Multiple input files and output files in awk

I have a folder full of text files named 000.txt to 181.txt. How can I process all of them (on the command line) with the same awk script (program.awk) and send them to their respective output files ...
0
votes
2answers
24 views

Which .bashrc file to edit

On my raspberry pi (running raspbian), I'd like to edit the .bashrc file so that various actions can be performed at every login. However, I have found two .bashrc file on the system: one is located ...
0
votes
1answer
15 views

Do filtergraphs copy audio streams by default in FFMpeg?

I 've got the following command in FFMpeg: ffmpeg -i file_input.mp4 -filter_complex split=2[i1][i2];[i1]scale=trunc(oh*a/2)*2:480[o1];[i2]scale=trunc(oh*a/2)*2:640[o2] -map [o1] -map 0:a -pix_fmt ...
0
votes
2answers
55 views

Bash scripting parted for GPT

Using Bash & Python scripts in Ubuntu 12.04, we are delivering a disk image to customers as a file (generated by dd). Once dd’d to the new disk, we resize the partition to fit the disk. Now that ...
1
vote
1answer
14 views

How to confirm apt-get confirmation during mysql-server installation

I am trying to write bash script that will install mysql-server-5.6 I want to ask user for password and then I will use it during installation mysql-server and some other configuration. But my script ...
2
votes
1answer
14 views

How do I encode a hyphen in a Bash terminal's open command?

I'm trying to write a small script that launches Beyond Compare when I do an svn diff. I got it working up until so far: open -a /Applications/Beyond\ Compare.app "$6" "$7" To get the full ...
0
votes
1answer
10 views

Alias to shortcut from home folder not working

As per this question on How to set up a shortcut to a directory in Mac OS X Terminal? I've added the following alias: alias MeteorApps=‘cd ~/Documents/Github/MeteorApps’ By adding it to the bash ...
0
votes
0answers
13 views

How to get Fish shell and NVM both installed with Homebrew to work together?

I am trying to manage my packages for OSX using Homebrew as much a I can. I have installed both the Fish Shell and NVM using Homebrew but cannot get Fish to recognize my NVM installation. NVM ...
0
votes
2answers
20 views

Can bash `locate` command generate numbered results / aliases?

I want to avoid having to type or copy-paste a full path. Ideally, I would like to see and be able to do something like this: $locate test.txt 1 /dir1/test.txt 2 /dir2/test.txt $ vi !1
0
votes
0answers
8 views

Distinguish TAB and ENTER from C-i and C-m in .inputrc

The history: I'm remapping most of the basic commands to move, delete, search history for all my command-line based applications (Bash, Python, SQLite, etc) by modifying the .inputrc file in my home ...
2
votes
1answer
24 views

grep -l output filenames with spaces

I want to loop over files with for f in `grep -rsl "foo" . `: do sed -i -- "s/foo/bar/g" $f; done; But since filenames contain spaces, a filename is split whenever a space is found. How can I ...
0
votes
1answer
26 views

After creating .bash_profile…Terminal not working

I created a new .bash_profile file and entered the following: export PATH="usr/local/bin:usr/local/sbin:usr/local/mysql/bin:$PATH" I then deleted .profile. Because from what I learn't it causes ...
0
votes
2answers
34 views

How to copy file using awk based on time creation to some directory

I trying to copy a file to directory using awk filter based on time creation file #!/bin/bash dir=/home/resaputra23/pyexample/python2/* des=/home/resaputra23/pyexample/backup/ file1= stat $dir | awk ...
0
votes
0answers
13 views

Mac OS X: Shell command for Accessibility -> Sound -> Play stereo as mono? [duplicate]

The question is in the title. I need a quick way to turn the feature on and off every now and then. Is there a bash command for it?