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

learn more… | top users | synonyms

3
votes
0answers
190 views

Bash auto-completion af variables adds additional white space at the end

when I perform an auto-completion of a bash variable an additional white space is added at the end. $FO[TAB] -> $FOO" " I added the quotes in order to denote the white space. The problem is ...
2
votes
0answers
46 views

Cannot Stat Error When Copying From Android Phone to Ubuntu 13.10

I am trying to move a video file from my phone to my harddrive via a script and am running into trouble with permissions. I am using the following command: sudo cp ...
2
votes
0answers
90 views

How to register shutdown script on Amazon Linux in AWS EC2

I am using Amazon Linux (RH-based distro) in AWS EC2. I followed the structure of /usr/share/doc/initscripts-*/sysvinitfiles to create an init script in /etc/init.d. /etc/init.d/do_something ...
2
votes
0answers
254 views

tar: Cannot create symlink : File exists

I backup lots of gigebytes files in to myproject.tar.gz, and compress success without errors. Now, I want to decompress all to an folder "myprojects". adan@adan-Latitude-D630:~$ tar zxf ...
2
votes
0answers
73 views

Is there a way to get the path of a bash script when used in the source command

I want to set an environment variable relative to the location of a script. I can easily find and set it for the duration of the script (test.sh): #!/bin/bash export MY_VARIABLE=$(dirname $0) echo ...
2
votes
0answers
37 views

scp doesn't work when my .bashrc is echoing to console

Ok, so I have used linux for a long time but this is the weirdest thing I have encountered in a long time. Maybe I just don't do a lot of scp so probably missing something simple here. So in my ...
2
votes
0answers
85 views

Coloured commands in terminal prompt

I've customized the prompt in my Mac terminal like this: export PS1="\[\e[31,1m\] \w $ \[\e[0m\] " This way I get the /working/directory $ in bold red, but I also want to get the command I execute ...
2
votes
0answers
187 views

Open only the first 10 lines of large CSV file in LibreOffice Calc

I will start receiving many large CSV files, of which only the first few lines are of interest to me. I was hoping to open them by piping only the first few lines to Calc, but this doesn't work: $ ...
2
votes
0answers
75 views

Trying to bind <ESC> to keysequence “öö” in bash vi mode

I am trying to use the german umlaut "ö" in a sequence "öö" as a binding for ESC. Having the following in my .inputrc does the job with "jj" instead of "öö"; however, when changing "jj" to "öö", it ...
2
votes
0answers
103 views

How can I tell what command is running on the remote end of an ssh connection?

Tl;dr - how do I find the name of the command (eg $BASH_COMMAND) running on the remote end of an ssh connection? ... My example setup is two tmux vertical panes, LH pane runs a local vim session ...
2
votes
0answers
153 views

bash column command confused by ANSI color escapes

I have a bash script I got from Gary Bernhardt's dotfiles that prints a nice colorized listing of the recent git commits. It uses the column command to line the output up into columns. On my mac, it ...
2
votes
0answers
158 views

rsync: large exclusion list adding 10 hours to sync

I have had an rsync backup script running on a Centos 6 box that has been syncing ~410gb of data from a local (LAN) server over a gigabit connection. This script runs hourly, and if there are no new ...
2
votes
0answers
88 views

Is it possible to check which stream is used by the command? (bash)

I have an irritating problem: redirecting stderr does not work. I get: iptables: Chain already exists I can't be bothered to check if a chain exists already (pointless, iptables just throws an ...
2
votes
0answers
148 views

Bash: color prompt and command differently from output stream

I'd like to color the prompt and command of my shell differently from the text printed in the output stream. My current export for PS1 is as follows: export PS1="\e[0;36m\h:\e[m ...
2
votes
0answers
150 views

How to disable alternate buffer in GNU screen itself but not for vim, less inside it?

What I would like to accomplish is mouse wheel scrolling behavior that I'm used to in a regular ssh session. In bash prompt mouse wheel should scroll my terminal output, and inside less/vim - the ...
2
votes
0answers
197 views

Problems with bash script, mysql inserts and launchd

I am developing a automated system, which consists of 3 parts: mysql, bash and launchd. Bash script takes folders of work related stuff, zips, archives and puts info about them into database that is ...
2
votes
0answers
274 views

Process ANSI escape codes before piping

I'm trying to pipe the output of a script (Mocha) to another script. However there is one problem: Mocha generates quite a few ansi escape characters to update the screen on the fly. These characters ...
2
votes
0answers
299 views

Why does this line appear every time I launch iTerm on my MacBook?

So I use iTerm on my MacBook Air and also my MacBook Pro. I've been playing around with .bashrc and .bash_profile and trying to come up with clever ways to configure things. At one point I decided I ...
2
votes
0answers
403 views

How to mount SMB share from terminal using keychain?

I need to be able mount a SMB share from terminal, for MAC OS versions (10.7). Is there a way to use mount_smbfs with keychain so I don't get prompt the username/password or have to add it to the ...
2
votes
0answers
916 views

Grub: Legacy 'ask' parameter no longer supported

I'm trying to change the resolution on my base shell (the Ctrl+Alt+1) shell in Debian so that it supports my ViewSonic monitor. The shell appears really fuzzy when it is displayed on my lcd monitor, ...
2
votes
0answers
204 views

Branch names not showing in Mercurial's tab completion

I have a development machine running mercurial 1.6.3. Tab completion in bash works great for completing commands, tags and branch names. I've set up a new machine with the same mercurial version (both ...
1
vote
0answers
19 views

How to give each virtual terminal in GNU Screen it's own background color?

I have a dream: I want each virtual terminal within GNU Screen to have it's own unique background color. I think I can fake it in an .bashrc script that emits xterm control codes to set background ...
1
vote
0answers
12 views

Auto find file parameter in bash

I've been trying to construct a method for bash to auto complete a file argument. so when you type vi not[tab][tab] it auto completes to notes.md if it is within the history or path or gives a list of ...
1
vote
0answers
36 views

popd and pushd behavior with “-n” option

I've been experimenting with pushd and popd in bash (Cygwin, man page says "GNU bash 4.1") and the man page doesn't quite seem to match the behavior. For pushd, the command % pushd +1 both ...
1
vote
0answers
40 views

How can I redirect OS X dtruss output when running with sudo?

I'm running dtruss on Mac OS X 10.9. Simple example is: sudo -c ls But I'd like to capture the dtruss output into a file. I saw something that suggests that I can do something like: sudo bash -c ...
1
vote
0answers
31 views

Recursive search occurs instead of last command when using up arrow.

I'm using an internal product "shell" based on spring shell. When I press the up arrow to get my last command, instead I get (reverse-i-search)`': Retrieving the last command works for all my ...
1
vote
0answers
33 views

Dtrace shows posix_spawn called with only 3 argument. Trying to launch by hand

I ran dtruss on a process that launches another one: the League of Legends Launcher starts the main game process with certain arguments that I can't seem to pass via the command line. What caught my ...
1
vote
0answers
19 views

Reusing _kill completion in .bashrc fails

I'm trying to extend bash completion alias perf-connect-process="perf record -p"; alias pperf=perf-connect-process; complete -F _kill perf-connect-process; complete -F _kill pperf; by reusing the ...
1
vote
0answers
36 views

Restore Launchpad DB from Backup using Bash/Terminal?

Context: I'm using an OSX shell script to update my settings system-wide after a fresh OS install. One snag I've ran into is restoring Launchpad. I have my launchpad DB backed up via GoogleDrive at: ...
1
vote
0answers
54 views

Edit text file contain unknown format

I have a text file when I open it with gedit warn me: and when I open with emacs: I have another file with this character and I want to remove this character from that file with a bash script.
1
vote
0answers
13 views

Splitting tar archives and uploading them one at a time

I want to backup my systems to split tar archives with a script uploading them one by one. It has to create the split archive and then run a script. The script uploads the part and deletes it. This is ...
1
vote
0answers
56 views

Unable to access samba file share after mounting on Mac

I am trying to automate mounting, copying a file to a samba shared folder and then unmounting the drive from my Mac. I wrote a simple bash script to do it #!/bin/bash echo "Mounting Drive" mkdir ...
1
vote
0answers
74 views

How can I get Homebrew and MAMP (Pro) to play nicely together?

I am using MAMP Pro for most of my local application development and am trying to install ruby , etc via homebrew however homebrew will give me the following warning: Warning: "config" scripts exist ...
1
vote
0answers
44 views

Terminal's bin/bash not responding

I have Googled through several instances of this issue but cannot get Terminal to open up with bash. I restarted the program, the computer and even logged in through another Administrator account but ...
1
vote
0answers
20 views

Path slashes disappear on coloured bash prompt

So in my .bashrc, I set my prompt to be colourful by setting PS1 to \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ For some ...
1
vote
0answers
296 views

What is the different between “sudo su” and “sudo bash”?

In Ubuntu 13.10, for the default setting, the following command in Terminal user@host:~/path$ sudo su results in entering an prompt root@host:/home/user/path# And this command ...
1
vote
0answers
209 views

execl: couldn't exec `/bin/sh'

I accidentally moved the whole bin, boot, dev and etc directory. After moving everything back I get the following error email from various cron jobs: execl: couldn't exec `/bin/sh' execl: No such ...
1
vote
0answers
352 views

Postgresql query within a bash script

We are having an issue with a postgresql bash query. The output of the query from the bash script add's additional quotes around the date. Please can you help me fix it?! Script: #!/bin/sh ...
1
vote
0answers
90 views

Can I reverse the stream direction of my terminal?

I'm not sure on how to word this question any other way but that's it. Is it possible to reverse the way your terminal prints text? For example if I type a command, I type it from the bottom of the ...
1
vote
0answers
241 views

find command with exec sh doesn't work in shell script but in commandline (raspberrypi)

I want to find "old" folders in /volume1/photo/ipcam which are named like "????-??-??" and move corresponding folders within dropbox (with the same directory structure /ipcam/...) to the subfolder ...
1
vote
0answers
52 views

Cron deamon written in shell

I'm looking for a script in bash or ksh, that would do ... more or less ... the same as crond. The situation is, that our system administrator suddenly denied the use of crontab to all regular users ...
1
vote
0answers
71 views

mergecap fails to create output file when run from crontab

I have created a script to merge pcap files using 'mergecap -w '. The script doesn't work as the output file is not already present. So I tried to use 'touch outputfile.pcap' before the mergecap ...
1
vote
0answers
320 views

Upgrading Chromium OS to Chrome OS mount error

I'm trying to upgrade Chromium OS to Chrome OS with http://goo.gl/4suhf. Unfortunately, when running this script (inside Chromium OS), it says: wget stuff unpacking zipfile RootFS Start: 286720 ...
1
vote
0answers
24 views

Tab completion that honors $CDPATH

I've installed bash_completion and set my $CDPATH. I can successfully cd to subdirectories of those in my $CDPATH. What I'd like to do from here is for tab completion to bring up files in those ...
1
vote
0answers
87 views

Unintended autocomplete or alias in Terminal

There is a "strange" autocomplete function in my macbook. If I try to type "ps -aux" in terminal (iTerm or TotalTerminal) with the hit of "s" in ps, automatically this happens: "ps -p $$ # Tells the ...
1
vote
0answers
145 views

Writing CPU usage by core and RAM/CPU usage by process to a logfile in OS X

I am writing a script that writes memory and CPU usage to a log file, every hour on a cronjob. The logfile will look something like this: "/n====CPU usage by core====" Core0: 59.05% used ...
1
vote
0answers
185 views

Bash 4.2 on Windows without virtual machine?

I'm looking for the way to run bash 4.2 on Windows without a virtual machine. I've tried with CygWin, but the latest version that you can install is bash 4.1, and I didn't find a way to install bash ...
1
vote
0answers
37 views

Msys cd .. command takes me to home directory instead of parent

I'm using Msys on Windows 7 with what I believe to be a Bash shell. I want to navigate the following directory structure: Drive (M:) +--- Coding +--- CPP +--- projects +--- ...
1
vote
0answers
73 views

Ncat throws errors while being run from crontab

I have a simple script set up on my OpenWrt box to check if one of the computers in a local network is streaming, and if it does, the script starts wget | madplay to play the stream. Script works ...
1
vote
0answers
48 views

shell script for finding the unix noun phrase

one entry in the on database is: LPE-1*story#1/1 of pearl#1/2*historia de la perla*storia della perla* histoire de la perle* história da pérola*istoria perlei*TOPIC The fields are separated by ...