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

learn more… | top users | synonyms

0
votes
0answers
11 views

Choosing shell for xterm in Cygwin

Basically my question is closely related to this one: http://stackoverflow.com/questions/21905380/how-do-i-get-cygwin-xterm-to-use-bash-and-not-sh I also want to set bash as the default shell for ...
1
vote
1answer
32 views

Read each line and use the line as input

What I want to achieve is: 1.Read a file line by line. 2.Put each content in a variable (stopping at the EOF, problem here is I don't know how many lines there is) 3.Use the variables ...
6
votes
1answer
465 views

Meaning of . and .. directories in linux

When display hidden file and directory in terminal using ls -la it show two directory i.e. . and .. and when list the content of dot(.) directory it contain all file and directories that is in it's ...
2
votes
0answers
17 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 ...
1
vote
1answer
45 views

A while or until loop, until a line with “REMOVE” content in bash. How do I do this?

I want to grep Ip addresses in a file until line with the "REMOVE" content. I tried the following thing but the script gives all IP including after "REMOVE". a="[A-Z]" cat *.txt| until [[ "$a" = ...
1
vote
4answers
59 views

Find all files where other files with different extension dont already exist

I want to use the find command, to find all files with a certain extension (avi), where the same filename with another extension (mp4) does not already exist. so considering these files: a.avi a.mp4 ...
0
votes
0answers
26 views

How to set my special keys keycodes in linux (ctrl+right etc…)?

Most of the convenient key combinations are not working on my debian with zsh and emacs and mostly everything, unless they bind it in a configuration file (CTRL+<direction>, ...
0
votes
0answers
18 views

FFmpeg/Avconv: Scaling Filter “Error when evaluating the expression”

I'm trying to scale a video with FFmpeg with the following command: ffmpeg -i input.jpg -vf scale="'if(gt(a,4/3),320,-1)':'if(gt(a,4/3),-1,240)'" output_320x240_boxed.png This is taken verbatim ...
0
votes
1answer
16 views

running for loop - but wait for string of words in log file to continue

so far I have this: for each in {01..10} ; do ./sb0$each/tomcat_sb0$each start;done that will start my apps at once, but I want it to wait until it reads one line in a file, what's the easiest way ...
-1
votes
0answers
19 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 ...
1
vote
2answers
15 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
10 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. ...
-1
votes
0answers
25 views

MacOS X write result from variable to file

When I use echo "$variable" > /path/file it works perfectly "from finger input" but when I try to use it within a shell script then nothing from $variable is written into the file. Any ideas ...
0
votes
2answers
21 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
33 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
18 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
20 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
36 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
22 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
22 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
25 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
15 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
27 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
12 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
34 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
5 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
17 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
35 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
11 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
30 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
62 views

Practical (closer 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
64 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
49 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
34 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
39 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
9 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
32 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
46 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
28 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
1answer
28 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 ...