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

learn more… | top users | synonyms

0
votes
1answer
39 views

Python debugger not stopping at breakpoints

I'm in a linux based development environment where I don't have superuser permissions. My basic issue is that the breakpoints I set in emacs through pdb never work. The debugger never halts at those ...
0
votes
3answers
80 views

Print previous 20 lines of text from a certain point of a text file

Currently: I'm new to scripting, teaching myself as i go along and this is my first script I'm developing. What my script is trying to do is look at specified file, scan the file to find the word ...
0
votes
1answer
12 views

What is KNOPPIX shell's start-up file?

I'm trying to install virtualenvwrapper and I got to change the settings of my shell's start-up file (like .bashrc, .zhrc, .profile, etc) to write this: export WORKON_HOME=$HOME/.virtualenvs export ...
1
vote
0answers
20 views

How to show git branch in Emacs shell

How can I show the current git branch as part of the Emacs shell prompt? For example, I have this in my ~/.bash_profile (I'm on Mac OSX 10.9 Terminal): parse_git_branch() { git branch 2> ...
0
votes
1answer
23 views

zsh completion for all executables in path

I have written a script which itself takes as an argument any arbitrary executable in my $PATH. Is there a way to create a zsh (or bash) completion function such that I would be able to type myFunc ...
1
vote
0answers
22 views

Can I have server and client on the same machine and run network bandwidth test using iperf?

I have two ethernet ports (eth0 and eth1) on my system. I've tested the bandwidth with two systems and got ~940Mbit/s. If I use one of the ports as server and the other as client, I always go through ...
0
votes
1answer
54 views

Percent sign in bash is not typeable

I have a strange problem: I cannot type or copy the percent sign in my bash... I tried to read ~/.bashrc, /etc/profile (and stuff in /etc/profile.d). I also tried sudo bash, but still not possible to ...
2
votes
1answer
78 views

How can I check if a file is newer that the target file in a shell script

How can I check if a file is newer that the target file? In a shell script, intended to run on a Mac, I want to do something like this: #!/bin/bash if [ $SourceFile dateisgreater $TargetFile ] then ...
1
vote
2answers
20 views

How do I output this line to a remote file?

I'm using a bash shell and trying to figure out the right way to write the following: ssh mysuer@remotehost 'echo "update user set url = \'localhost\' where url = \'mydomain.com\';" >> ...
0
votes
3answers
52 views

Multiline && combinator operator for command chaining in batch file

I see that this operator is used in windows (and might be Linux?) to chain/combine multiple commands in one line. Commands are executed one after another, as long as preceding complete successfully ...
0
votes
1answer
28 views

How is the “builtin” bash command defined?

I noticed that command like cd .. is actually converted to builtin cd .. and then executed. But how is builtin defined? which builtin doesn't show anything and it's not in /bin, /usr/bin etc. Is it ...
1
vote
0answers
37 views

Cygwin and Cygwin64 missing prompt in terminal

I tried to install and reinstall cygwin and cygwin64. I also tried different mirror sites. Instead of seeing a line like user@PC~ $, I see a blank screen with a blinking cursor. The properties of ...
1
vote
1answer
36 views

Duplicate a remote session in terminal in Linux (Ubuntu)

How do I duplicate a remote session in the Linux (Ubuntu) terminal? For example, if I have an SSH session open, how can I duplicate this session in the terminal?
0
votes
1answer
43 views

Resolved: Enumerating every other array element in loop

I have a dynamic array with key-pair values and I’d like to enumerate every other value. In this case, just the names in the array. Since I’m not using bash v4, I have been able to use seq to step ...
0
votes
1answer
76 views

Test USB 3.0 Device Speed

I've looked up hdparm, but all examples are for testing disks. Not sure if it can be used to test external usb devices (specifically usb flash stick). I'm using the following code right now: dd ...
0
votes
1answer
39 views

Mac OS X seems to be unable to find directory that certainly exists

For some reason Mac OS X cannot find a directory I just made. Any idea why? sh-3.2# mkdir /Users/Administrator/Documents/drive/ sh-3.2# mount -w -t "hfs+" /dev/disk1s2 ...
1
vote
1answer
53 views

Bash: better way to output to both console and output file than tee?

What I need to display is a log refreshing periodically. It's a block of about 10 lines of text. I'm using |tee and it works right now. However, the performance is less satisfying. It waits a while ...
0
votes
2answers
45 views

Adding subtitles for multiple mkv files by MKVmerge using terminal

I'm trying to adding subtitles for multiple mkv files. I use this script for doing this : for file in *.mkv; do "/Applications/Mkvtoolnix-7.0.0.app/Contents/MacOS/mkvmerge" -o "${file%\.*}(1).mkv" ...
1
vote
1answer
20 views

Advanced Wget usage

I have a list of about 200 servers which contain links to individual files, for this question, let's just pretend they're .txt files. I need to download every file, however some servers only have the ...
0
votes
2answers
55 views

bash one-liner while loop to ssh into internal IP or external IP

I would like to have a while loop on my terminal screen that tries to ssh into my server every second. At the moment it looks something like this: while true; do echo INTERNALIP && date ...
1
vote
1answer
336 views

Permanently remove an environment variable

While installing Android Studio, it installed Jayatana as a dependency. Now when I ran java, it showed me a message as: Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar I ...
0
votes
1answer
23 views

Linux sort Command: how to sort on a number embedded in a field?

I'm on RHEL 6 using BASH. I'm trying to sort some lines in a file, by a number that is embedded in a field. The name of the file is word.txt. This is the command I am using: sort -n -k4 word.txt ...
0
votes
1answer
29 views

Script to delete all non-admins with launchd or logout script on OS X

I've found a number of articles that touch on this subject but they are not running for me or perhaps because they are years old they do not work OS X 10.10 Yosemite. In short we run Deep Freeze but ...
5
votes
2answers
219 views

What's the differences between all the shells, zsh, bash, csh…, why are there so many? [closed]

My understanding of shell is an interpreter between me and the OS. So it will translate my command and call the right program to perform it. For this simple task, why there're so many shells existing? ...
0
votes
1answer
21 views

My bash_prompt cannot find a shell script

This is a function I added to my .bash_prompt function look_for_autorun() { echo "checking file" FILE="autorun.sh" if [ -x $FILE ] then echo "File '$FILE' Exists" else ...
0
votes
0answers
20 views

“unable to remap to same address as parent”, can't get rebaseall to fix the issue

I posted this question on the Cygwin mailing list with no response, so I'm trying here. I keep getting this same unable to remap error and rebaseall does not fix the problem. Specifics: On running ...
0
votes
1answer
31 views

$RANDOM in script vs. on command line

I think I found a really odd bug in Bash's random number generator ($RANDOM). Showing is easier than telling, so here's what happens: The goal is to get random digits. If I execute this, I get 20 ...
1
vote
2answers
36 views

Spaced string variable as command parameter inside shell script

How can I store a spaced string in a variable and use it as a command parameter inside a shell script? This is what I'm trying to do: DESTINATION='/mnt/External Harddisk' ...
0
votes
0answers
44 views

Change vagrant box prompt color

The standard purple in the vagrant shell is not readable in my terminal. I don't understand the way PS1 is set up so I'm hoping someone here knows how to get change the color. Perhaps thin letters in ...
0
votes
0answers
23 views

Having trouble building Vagrant bash script

I'm trying to set up a bash script provision to help build my virtual machine with Vagrant, but I'm clearly doing something wrong. Unfortunately the Vagrant docs don't provide any examples more ...
-3
votes
1answer
51 views

Scripting for table data in a file

I have the following data file, EMP.txt: SNO,NAME,GENDER,COMPANY,EMPID,SALARY,JOINING_DATE,PHONE_NO,LOCATION 1,sravan kumar,M,ibm,1095,20000,01-SEP-2014,7651523,HYDERABAD 2,Vijay ...
0
votes
1answer
45 views

bash- how can I use wget to send POST data with files?

I want to make following POST request to my server using wget: email=abc@abc.com&file1=@FILE_HERE&file2=@FILE_HERE In above request, there are three POST parameteres called email , file1 ...
0
votes
0answers
8 views

How to make Konsole invoke konsole -ls for all users?

I admin a linux domain for students. The students use their lab workstations in graphical mode, but often use Konsole on KDE for ssh and programming tasks. I know Konsole can be configured through ...
0
votes
4answers
56 views

Go to directory of a file path

Is there a way a cd command may accept a regular file path and jump to the dir where the file resides? Image you could do: vim /usr/share/drupal7/sites/all/modules/legacy/legacy.module cd ...
1
vote
1answer
102 views

How to run a bash script and display any output in Conky?

The Bash script I’d like to run in Conky is a loop so only needs to be run once. It’s a monitoring script in case my VoIP router goes down. ${execi 3600 /home/justin/pingvoip} Conky doesn’t want ...
0
votes
1answer
33 views

Cannot Install sklearn with pip on Mac

I got the following error message when trying to install scikit-learn on a Mac: http://pastebin.com/sfsbqcm6 I tried to install scikit-learn using this command: pip install scikit-learn I found on ...
0
votes
1answer
18 views

Keyboard shortcut to kill a script containing multiple wgets?

I have a Python script that wgets a load of files: for year in range(2010, 2015): for month in range(1, 13): filename = url filename += "/T%s%s_BNFT.CSV" % (year, month) ...
0
votes
0answers
26 views

Copying from Emacs to other tmux pane (code execution for Ipython, sql, bash, etc)?

My preferred setup is running a terminal window with several tmux panes (a couple of shells, and an emacs session). What is the easiest way to send code from the emacs pane to be executed in the shell ...
0
votes
1answer
36 views

Bash - Parsing XML output of nmap

I am trying to write a bash script that will take port id I retrieve from an nmap command, and then use those ports to send a file using netcat. So I got some basic knowledge using this link, How can ...
2
votes
1answer
18 views

How can I swap patterns in filenames?

I have a folder of files with names like thing.y.big.png thing.y.small.png thing.xxx.big.png thing.xxx.small.png and I would like to rename them so that the 2nd and 3rd "fields" are swapped. In the ...
1
vote
1answer
44 views

Get current network speed in bash

Is there a method to get the current network speed (just like I can get with «nload») in a bash script? I would just put into a variable the speed at the moment where script is running. Ex: ...
0
votes
1answer
9 views

CentOS6 Backup fails; “permission denied”

I am currently trying to do a backup of a server and am getting an error message when running my script. The script runs correctly on certain directories, but for the directory I am attempting to use ...
1
vote
1answer
48 views

piping tail -f into sed or awk

There is another question which is nearly the same, but none of the suggestions from its answer works for me: Piping tail -f into awk I'm trying to tail -f a logfile but want to replace \r with \n ...
3
votes
1answer
65 views

What does the output of 'ss -s' mean?

I have a problem understanding the output of the Linux ss (socket statistics) command. I can not understand the meaning of the output of ss -s For example: [root@dls2304-1 ~]# ss -s Total: 973 ...
0
votes
2answers
30 views

Zero out files in folder(s) that have space in file name

I'm trying to zero out (truncate) all the files in a folder or subtree that match a wildcard. Another post recommended using the find … -exec method over for variable in wildcard, which received high ...
0
votes
1answer
42 views

How to handle a condition when an expect script executing another script on a remote host is interrupted?

Im using an expect script to say xyz.exp to login to a remote host and execute another script abc.sh Now most of the times abc.sh runs fine, but there is a scenario where if a certain condition is ...
0
votes
1answer
25 views

Running the command “bochs -q” from Cygwin fails

I'm having troubles to execute the command "bochs -q" from Cygwin. I have installed the XV6 operation system in my C drive. I'm using Cygwin in order to compile the XV6 files, that is execute the ...
0
votes
1answer
17 views

Running a script if X server haven't been receiving any input for some time

I want to run a certain script when I'm not around my machine so it would run automatically but it would not bother me when I'm working. I created the bash script and queued it with cron, but it ...
-1
votes
2answers
50 views

simple loop not working

A simple script now="$(date +'%d_%m_%Y')" path="/var/www/vitalii/backups" sites=("site1.ru site2.ru site3.ru") for i in ${sites[*]} do echo "$path/$i" #tar -cvzf $path/$i_${now}.tgz ...
0
votes
1answer
36 views

Start two scripts that run indefinitely in shell script

I'm a webdev and I am using JSX compiler and SASS preprocessor to compile my .jsx and .scss files. When I start working, I launch these two separate commands: jsx -x jsx jsx js --watch --no-cache-dir ...