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

learn more… | top users | synonyms

-1
votes
0answers
10 views

OpenGL and Minecraft disagree

I have recently had issues with GNOME3 (as I have said in another question), and had to move to KDE. Now, not only does KDE freeze every few minutes, but Minecraft refuses to see OpenGL. Any ...
0
votes
1answer
9 views

htop status bars in motd

I'd like to put the htop status bars, that show the percentage of CPU usage and memory, in my MOTD, so that every time I log in I see an overview about the systems health status. Any idea how to ...
0
votes
0answers
9 views

Customized bash prompt (PS1) issues when text moving to next line and back.(word wrapping)

I'm using a customized prompt which includes and output of a "case" script and also colors it. When the text is colored I'm having line wrapping issues, when I remove the color - the issue is gone. ...
0
votes
0answers
18 views

MacOS X write result from variable to file.

Hello actually iv little problem. echo "$variable" > /path/file Works perfectly "from finger input" but when i try to use it as a shell script then nuthin from $variable is presented into the ...
0
votes
2answers
18 views

Take a screenshot in mplayer2 and upload it to an image sharing site in one keypress

I have a bash script that uploads screenshots to imgur. I want mplayer to take a screenshot, and then upload it with the bash script, and all that in a single keypress. Is there a way to queue taking ...
0
votes
1answer
26 views

Bind bash script to keypress

How do I map a keypress on a keyboard to a bash script? For example, when I press the "Esc" key, the script is run. OS: XFCE Spin Fedora 19 ---- EDIT ---- I need to set this via the console. This ...
0
votes
1answer
17 views

batch rst2html conversion in a bash script

I have multiple .rst files in multiple folders and sub-folders on my Debian system. How can I create a script that converts all the .rst files in html (with the rst2html command) and creates new ...
0
votes
1answer
17 views

a script that multithreads using bash/batch and nconvert

i have over 500 (50MB) .tif files and i want to convert them to .png i have tried nconvert and find it working, but there is no multithreading, is there a simple way of doing it in a bash or batch ...
0
votes
2answers
34 views

Making PS1 prompt refreshable

I want my prompt to be changed based on an output of a certain command. and based on the command result to add a color. example: run the command: cphaprob stat | grep local | awk '{ print $NF }'` ...
0
votes
1answer
10 views

alias can't find a file that actually exists

On my personnal computer, not a server, in my .bash_profile (I'm on OSX) — sym-linked to .bashrc, I have the following line among some others : alias deploy=sh ~/dir/ectory/deploy.sh The file ...
1
vote
2answers
19 views

How to stop shell script if curl failed

I have script that used curl when i pass wrong parameters to script curl failed but script continue executing. I have tried use curl -f/--fail parameter but problem does not solved. What is the best ...
1
vote
1answer
16 views

Zsh autocomplete function with sed

I'm struggling to write an ZSH autocomplete function. My goal is to autocomplete ta's and tk's first argument with the projects listed in tmux list-sessions and tmuxinator list. Here's what I have so ...
0
votes
2answers
24 views

Bash : conditionally moving nested duplicate directories

Assume I have a directory named "foo" that contains several directories: foo/bar/bar/(files) foo/bat/bat/(files) foo/baz/qux/(files) Is there a way to conditionally move the 'deepest' directory up ...
0
votes
0answers
14 views

stdbuf not working while unbuffer does

I am trying to apply timestamps to stdout of a process. For the proper timestamps to be applied, I attempt to unbuffer stdout of the process. This works with unbuffer but not with stdbuf as I would ...
0
votes
0answers
9 views

Unbuffer swallows the exit status of killed process

The expect "unbuffer" command seems to swallow the exit status of its child if the process is killed. Is there something that can be done to stop this behavior? It does not swallow the exit status if ...
0
votes
1answer
6 views

How to check core dump enabledness status in bash?

$ ulimit unlimited $ sleep 2 && killall -SEGV cat & [1] 11358 $ cat Segmentation fault $ ulimit -c unlimited $ ulimit unlimited $ sleep 2 && killall -SEGV cat & [1] 11462 $ cat ...
1
vote
1answer
24 views

Strange probs with popd and pushd

Just when I thought I got popd and pushd, when I tried to practice on my own...it all went to hell. I removed the temp directory.I verified this by going through Finder. Then I made a new set of ...
0
votes
0answers
26 views

Unable to run tmux on OS X

So I got brew on my mac and I had tmux installed and running just fine. Then after I refreshed my system every time I try to run tmux i get this error: "-bash: tmux: command not found" So since I'm ...
0
votes
0answers
10 views

How can I get bash to perform case insensitive tab-completion for my aliases and functions?

I have a alias like this: alias sshUntrusted='ssh -X -C -c blowfish-cbc,arcfour' when I type: $ sshun bash does not complete this alias I have put set completion-ignore-case on #ignore case ...
0
votes
2answers
33 views

Please help me visualize popd and pushd

I'm working through The Command Line Crash Course. I've been doing really well, but now find myself completely stumped at popd and pushd. I've read the analogy of a stack of plates or pancakes. I ...
0
votes
2answers
21 views

File sorting confusion

Q1. I have a command and I'm confused why it's sorting the filesizes by Kilobytes then Megabytes? $ find ~ -maxdepth 1 -size +1024c -type f -exec du -h {} \; | sort -nr 80K /home/sl6/S3401636/Lab 4- ...
0
votes
0answers
4 views

getting disk identifier from the disk name

Is there a way to retrieve the disk identifier from the disk name? For example I have a disk partition /Volumes/Data and I would like to store the disk identifier in a variable. Any help?
0
votes
1answer
13 views

Cygwin: Run a script in mintty/bash

Initially asked on SO.com, but I closed it. I think it better fits SU.com. Please tell me if it is also not the right place. I want to add a context menu to a .sh file to run it in cygwin. I tried ...
0
votes
1answer
34 views

Change user AND environment in bash script

Why does this work (as root): $su - aba ~> echo $JAVA_HOME Ausgabe: /usr/java/jdk1.7.0_45 And not this shell script (also run as root): #!/bin/bash su - aba << EOF echo $JAVA_HOME > ...
1
vote
0answers
10 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
28 views

IDE for Bash shell scripting on Ubuntu?

I'm probably looking for the Holy Grail here, but I figured I'd ask. Is there an IDE for Bash shell scripting on Ubuntu (Ubuntu 12.04 in my case)? Something with a code editor that lets you set ...
3
votes
2answers
51 views

Practical (closest to the classical Linux one) way to use (automate) SUDO for CygWin

Being able to use sudo commands in CygWin is useful, and faster than opening an elevated shell: Luis@Kenobi /cygdrive/c/Users/Luis $ net user /add TestUser System error 5. Access denied. Luis@Kenobi ...
1
vote
3answers
59 views

Can anyone explain why this pattern matching is not working using sed

Trying to print out specific times of logs based on recommendation from this thread from super user. I am not sure why my patterns are not being matched by sed. I have the sample date and time I am ...
1
vote
1answer
46 views

Matching only numbers that come in numerical order

I have numbers in [.] indicating the page number of an orginal printed document I am transcribing. However, the document also contains other numbers in [.] that do not correspond to page numbers. For ...
-1
votes
1answer
20 views

Problems in CygWin accessing /dev/nul as non-privileged user

NOTE: This question is originally a simple typographic mistake (nulinstead of null) for the questioner. Anyway, the details could be useful for anyone having the same error and arriving here ...
-1
votes
0answers
19 views

Move a dir which contains compiled apps

I want to move a dir e.g. file_download to myappDir. I know I can do this via mvcommand. The main problem I have are compiled apps within my dir file_download. And after compile has been finished I ...
0
votes
1answer
30 views

Running a script from ssh, logging out and continuing the script

The overall question here is - how do I automate sshing into a machine, running a script, and exiting without killing the script? I know that this has been answered several times, but I'm not having ...
-1
votes
2answers
32 views

Unable to boot Windows 8 after an interrupted Ubuntu installation attempt

I have a Sony Vaio notebook with Windows 8(UEFI) installed,after trying to install Ubuntu 12.04 LTS(I cancelled the installation and restarted the pc) from a usb sticky,every time i turn on the ...
0
votes
0answers
7 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 ...
0
votes
0answers
12 views

Script to open mutliple terminals with multiple tabs each, move and resize these and execute commands

So I am trying to make a bashscript, which does the above mentioned. Background is that I have to keep an eye on lots of logs, and theres have to have opened many console side-by-side. E.g. one ...
0
votes
1answer
18 views

ConEmu + bash CTRL+L no longer working

I set up the following task in ConEmu in order to run bash: C:\cygwin\bin\bash.exe --login -i -cur_console:d:C:\cygwin\bin. Up until today, it ran wonderfully. However, I updated cygwin today, and ...
0
votes
3answers
44 views

Grep for block surrounding an error message

I want to grep for the block of logs around a particular error message. Say I know my log looks like this: [----] I, [2014-04-10T19:12:36.294512 #1910:e93004] INFO -- : Started GET "/ems_infra/new" ...
0
votes
1answer
30 views

Bash alias with Sed not working

Does anyone know why this alias isn't working? alias tailsed="tailf error.log | sed -e 's/\\n/\n/g' -e 's/\\t/''/g'" I've tried replacing the single quotes with doubles so that it's like: alias ...
0
votes
1answer
27 views

how to give argument to multiple parameter calling bash

I know the title isn't very clear, but I don't really know how to state my problem. I have a shell, and I want to be able to call it using multiple parameters, some needing argument other not. ...
0
votes
1answer
25 views

How to print process id into statment

I have assigned a work to take take all process and make them into a statement. So I tried this script. #!/bin/bash a= ps | awk '{print $1}' echo select $a So I am getting this output PID 1838 ...
0
votes
0answers
24 views

configuring p4 on red hat enterprise linux

It's time to get rid of this simple but yet not easily explained topic. And whatever I got on internet, in one or other way, failed to sync my WINDOWS depot to RHEL client. Following is the stuff I ...
0
votes
1answer
20 views

Entering Password in su- through loop

The Scenario is like I have a list of root passwords. But i don't want to keep trying Manually. So i wrote the shell script : for i in {1..26} do su - >>result done and all my ...
1
vote
1answer
21 views

How do I identify shell script execution vs dot execution

I'm writing a bash script that needs to run on the current process for it to be useful. That is, I want to make sure that the script was invoked with source script.sh or . ./script.sh and not ...
0
votes
0answers
19 views

Kali Linux: Renaming files in bin

I'm just curious. I want to rename files in /bin such as - ls --> als //after I change it, the ls command no longer works and I have to use als instead - adduser --> aadduser - chmod --> achmod so I ...
0
votes
1answer
30 views

How to use cd to locate a file and then open the file in vim easily in least possible keystrokes?

Very often I find myself in a situation where I would cd into a really deep directory structure to traverse to a file and then would have to open the file in vim.. So while doing cd I constantly keep ...
0
votes
3answers
25 views

Disable repeated items in bash history

Bash in Fedora 19 is really annoying me. Say I run a command: echo "Hello" Then I run another command: echo "World" Now I run the last command (echo "World") again N times by pressing up on my ...
0
votes
1answer
11 views

touch -d alternative in MAC OS X

I need to change modification time of all my files in a folder 1 hour back (daylight saving issues with some software) The thing is that touch -m -r {} -d '-1 hour' Doesn't work on MAC OS X Any ...
1
vote
2answers
32 views

Change range of bytes by address in pipe

I've got some binary data that is streaming through a bash pipeline. The data is usually more than 50MB in size. The existing code looks roughly like this inputprocess | filter1 | filter2 | filter3 ...
2
votes
0answers
49 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 ...
21
votes
2answers
837 views

How to create a directory named '-p' under Linux with Bash? [duplicate]

In Bash, how could I create a directory named -p? mkdir -p failed. mkdir "-p" failed. mkdir "\-p" failed. mkdir \-p failed.