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

learn more… | top users | synonyms

2
votes
1answer
81 views

Print ssh and su chain

Is there a way to show the complete ssh and su chain in bash? For example. In Server A as user aa: su - ab ssh ba@B su - bb Thus, I would like a command that prints something like this: 1 bash aa ...
2
votes
1answer
141 views

Line wrapping issues in bash/php

I am writing a program that prints colored lines, and the more I do with it the more I find myself working around line wrapping issues that come up. It is a sort of terminal written in php, here is ...
2
votes
1answer
2k views

Tab Auto-Completion in Mac OS X when using sftp in terminal

i have been getting very frustrated lately since the readline functionality has been removed from MacOSX and Tab Auto-Completion doesn't work anymore. So i was wondering if anyone knew a good ...
2
votes
1answer
770 views

(-bash: initdb: command not found) When installing postgres mac

I get the following error (-bash: initdb: command not found) in the terminal when trying to install postgres on my mountain lion mac osx? Also, does any one have a good resource for installing ...
2
votes
1answer
102 views

Open application with lowered privileges

I have a mac installer which runs as root with pre and post install bash scripts. At the end of the post install script I launch the application which inherits and opens as root. Is there a way I can ...
2
votes
1answer
762 views

bash vi key bindings: Can I map keys? Display mode (insert vs command)?

I am a long time vi(m) user and recently made the switch to using vi key binding in bash. I can already tell that this will be an improvement, but I would like to customize a few things to really ...
2
votes
1answer
111 views

How to Mount vbox permanently

On my Ubuntu 11.10 machine, I use vbox (which is again an Ubuntu with source code on it). To take a daily update of a code, followed by testing - have to mount this box with every restart. Tried to ...
2
votes
1answer
528 views

Bash Shell Hangs on ?+Tab-complete

I often use tab completion in Bash when completing directories, but I find that it hangs for an unacceptable amount of time if I accidentally include a question mark in the directory. I'd like to know ...
2
votes
1answer
359 views

Porting GNOME keyboard shortcuts to URXVT

I recently switched from gnome terminal to urxvt (and installed tabbed extensions). I am also a heavy emacs user which uses a lot of key combinations similar to urxvt (tab related stuff) like Shift-...
2
votes
1answer
751 views

Can't start a service (sudo) remotely from script and keep it running

I have a service (tomcat) that needs sudo to be started. I made a simple script on the remote server in /root/bin/test.sh #!/bin/sh sudo service tomcat start read (The script needs to do other ...
2
votes
1answer
195 views

bash xterm : how to get command line before typing enter

I try to define a custom behaviour of the backward-kill-word function in bash xterm. For that, I need to catch the command line before validate it. For instances, if I type sdcds/edfdD sdf/sdf without ...
2
votes
1answer
401 views

Zsh's yank-pop is not working

In bash, you can kill words (Alt-Backspace) or lines (Ctrl-k), and yank them back later with C-y, and cycling the kill-ring with Alt-y. Now when I'm using zsh, it is weird that Alt-y is not working (...
2
votes
1answer
921 views

Copy files from m3u to destination

I have a playlist, m3u extended, formated like: #EXTM3U #EXTINF:213,2 Tåst - (foo bar) /home/www/Music/Test/test 123 - test.mp3 My problem is, that it seems the line-break is encoded as '\n\r' ...
1
vote
1answer
10 views

Fortran Compiler Installation Instructions for OS X

I try install fortran compiler for Mac OSX El captain. Firstly; I install install_f2c_osx.csh Run installation script $ chmod +x install_f2c_osx.csh $ sudo ./install_f2c_osx.csh It gives this ...
1
vote
1answer
52 views

Bash Scripting and quotation

I'm reading a couple of books on bash scripting, and struggling to understand proper quotation and the use of IFS. Perhaps someone can help me with a small example involving filenames with quotes. ...
1
vote
1answer
56 views

Windows 10 linux bash shell ctrl+space doesn't set mark in Emacs

In Windows 10 I installed Subsystem for Linux Bash. But I have a problem with shortcut in Emacs Ctrl+space doesn't set mark point. What i tried and didn't help: I tried to uncheck "enable Ctrl key ...
1
vote
1answer
29 views

Linux Shell script to change grep for a string, then comment out 2 lines above and 1 below the string found in the file

Looking for some help on this task. I have tried several shell scripts to do this, but not sure I am approaching this problem right. I have a file that contains several blocks of data like this: ...
1
vote
1answer
26 views

Line is not Wrapping in Terminal

I am using Ubuntu G-NOME 16.04. Line wrapping not functioning properly in my terminal. It starts rewrite at the beginning of the same line. eg. If I try to type follwining command user@MY-PC: ~$/home/...
1
vote
1answer
21 views

cat files from pipe

I have to join files to one original file, which was split. There is a catalog, in which there are a lot of files,but no every is necessary. I have file with md5sum, which contain md5sum files I have ...
1
vote
1answer
24 views

Bash completion: filter out backup (~) files

I would like bash to filter out backup files, with a name ending in ~ (tilde), when auto-completing filenames. I have written a script to set this when using vim (I have very little experience with ...
1
vote
1answer
30 views

Bash Script, Striping out newline characters in variable

Still getting the hang of bash scripting... I have a function that resizes images and calculates how much to scale it based on the file size. I need to pass this percentage as an argument to the ...
1
vote
1answer
81 views

How do I close a windows program in BASH

I use X64-based Win10. Recently, I started to use git, so I am switching the console to bash/mingw64. But I don't quite understand the way bash behaves. I tried to kill a program, say notepad, via ...
1
vote
1answer
40 views

Matching a randomly generated integer with a specific place value in a string

In bash I want to prompt user for input in a script. Lets say the input is: #!/bin/bash echo "Please enter a number." read NUM # User enters "12345678" How can I use the next command to generate ...
1
vote
1answer
38 views

How to run a sequence of bash scripts one at a time in Linux?

I have several bash scripts, or rather one script that has to be run multiple times. This script accepts several command line arguments and does something with them. I need to run this script ...
1
vote
1answer
34 views

Curl command to download a file over HTTPS

I need to download a particular file from https://file_path. Here is the curl command I use for that: curl --user user:password "https://file_path?raw" > location I wish to download the real ...
1
vote
1answer
29 views

Completion of arguments for Cygwin commands not working due to `.exe` extension

When using tab completion in Bash on a Cygwin system to complete the name of a command, the .exe extension is appended to the command name, e.g, typing opens and pressing Tab completes the command to ...
1
vote
1answer
236 views

Force download Windows update to build 14316

I’d like to try the new Ubuntu Bash on Windows, I’m already on the insider preview program and every time that I do a “check for updates” I don’t get any new update. My current build is 10585.218 and ...
1
vote
1answer
73 views

Linux ip route: How to make all external traffic go via one interface

I've set up an OpenVPN connection with an external server. tun0 is the interface which is used for this connection: user@mypc:~$ ifconfig tun0 tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-...
1
vote
1answer
28 views

How to show full network path of a file on a mounted share in OS X

Given I have a mounted share, in say: /Volumes/temp This might map to cifs://servername/temp Using bash, how do I get the network path to a file on the share, such as /Volumes/temp/folder/file....
1
vote
1answer
66 views

How do I remove the current directory (“.”) from my PATH?

I recently updated OSX to El Capitan, and in the process of running through the steps needed to update my development environment, I discovered something rather disturbing: bash is behaving as if . is ...
1
vote
1answer
17 views

How quoted args are handled by /bin/time

I'm timing a custom binary in the form: ./prog --opt1=arg1 --opt2=arg2 --opt3="arg3" It's required that the third option have a quoted argument. In a script I save all the options: exec=./prog opts="...
1
vote
1answer
38 views

Linux - create screen as another user

I'm trying to create a new screen on my server (CentOS 5.11), but instead of starting it with my user, I would prefer to use another user with restricted permissions, just to be on the safe side. So, ...
1
vote
1answer
35 views

Alternative to ls to group extensions before sorting

I'm looking for some way to modify/replace ls with a command that is capable of: Grouping directories first (as ls does) grouping files by user-defined extension groups (e.g., all image-type ...
1
vote
1answer
239 views

Gem Installs not executing after update system-wide update Arch Linux

When trying to execute sass --watch scss:css inside of a target folder I get returned the message command not found I know I had sass installed. gem list doesn't show that it's installed anymore. I ...
1
vote
1answer
39 views

How to construct a proper command string in bash? Quoting issues, I think

I have a very newbie question, I am sure. I am trying to construct a script to edit the internal EXIF timestamps of a number of JPG photo files, using the commandline exiftool utility. My actual ...
1
vote
1answer
37 views

unable to remove symbolic links of rsync copy of /bin and /dev

I accidentally made a rsync copy of my root directory, "/" using the -a option, as follows: user@mycomputer:~$ rsync -a / /backup-dir user@mycomputer:~$ ls -l /backup-dir/ total 10102784 drwxrwxrwx 1 ...
1
vote
1answer
68 views

Setting proxy settings to Auto Proxy Detection using command line on Mac OSX

I want to know how to set the proxy settings to Auto Proxy Detection like in network preferences, but using the shell. I have tried looking around but I only am finding commands like: networksetup -...
1
vote
1answer
39 views

Man pages are outdated

Background: I recently learned about the mv -t flag option in bash, but when I checked the man pages on my computer, there was no mention of it. The man pages were dated 9 July 2002. I ssh-ed into ...
1
vote
1answer
76 views

The “other” finger (GECOS fields at /etc/passwd)

in the file /etc/passwd we have the so called GECOS fields (which stands for "General Electric Comprehensive Operating System"), that is: username:password:userid:groupid:gecos:home-dir:shell ...
1
vote
1answer
49 views

Make `last` display year in Terminal

Is there any way to get last (on Mac OS X 10.11.2) to display a full date (including year)? Right now it displays only day and time: user$ sudo last user | head -n3 user ttys000 ...
1
vote
1answer
53 views

Prevent open -a Terminal.app from automatically exiting on Mac OS X

On my Mac OSX 10.9 Mavericks, I wrote a small bash script to open a log file for a terminal game application I'm writing so I can see print statements: #!/bin/bash printf '\e[3;0;0t' ...
1
vote
1answer
420 views

The “shmmax” value is too large when installing Oracle 11g on RHEL7

I am trying to install Oracle Database 11g Release 2 on RHEL 7.2. Executing runfixup.sh, it outputs: # /tmp/CVU_11.2.0.1.0_oracle/runfixup.sh Response file being used is :/tmp/CVU_11.2.0.1.0_oracle/...
1
vote
1answer
68 views

How can I configure git bash to display a timestamp for each command?

I run git's bash on Windows7 to manage source control for projects. Can I edit C:\Program Files (x86)\Git\etc\git-prompt.sh to enable me to timestamp when I ran commands? e.g. instead of user.name@...
1
vote
1answer
102 views

how can a file be removed and then cp can't write it?

I have a part of a bash script, which I am executing as root: rm -f ../../include/profile.h; \ cp profile.h ../../include/profile.h the file ../../include/profile.h in question has permissions: -...
1
vote
1answer
51 views

How to store an ssl key as a variable in a script for use with ncat?

I am trying to write a wrapper script to start an ncat listener. I don't want to have to output the certificate and key to a file, rather I'd like to store it as a variable within the script, and call ...
1
vote
1answer
36 views

using trap to close one program when another is closed

Ok...here's my goal....I use dwm, so normally I have no need for a compositing manager. That being said, there are times when I would like to have it running temporarily. There are times when I want ...
1
vote
1answer
224 views

ubuntu: profile.d and .bash_profile missing

I have done some reading up on Linux startup, etc and I noticed that in my home directory it is not present a folder profile.d: /home/user/profile.d/ # Doesn't exists and nor a file ....
1
vote
1answer
47 views

How can I cause a script to be run when a file is deleted?

I have an application which saves its data in the form of XML 'jobfiles' which contain lists of much larger .tif files that contain the actual raw data that the application generates. Typically, a ...
1
vote
1answer
133 views

User scope environment variable: PATH append string value to existing value

I want to know, how to to append value to existing PATH variable (user scope): SETX PATH "%PATH%;D:\Myfolder\Test\" The above script takes system path variable data using %PATH% and append my ...
1
vote
1answer
58 views

Make bash tab completion favor files/directories instead of $PATH

I'm standing in a directory that looks like so: $ ls build src utils Then writing this $ ut And pressing tab, makes bash autocomplete this: $ utmpdump What I wanted is to have ut<tab> ...