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

learn more… | top users | synonyms

0
votes
1answer
11 views

Adding wine to bash profile

I have installed wine 1.7.50 from source. There weren’t any .dmg or .app installers available on version 1.7.50 which supports DirectX11. So, I had to install it via terminal from source via the below ...
0
votes
1answer
20 views

yes command replacement unix shell scripting

Is there any command like yes command for Sun OS 5.8? I want to give to write a script which I need to press n continuously, which I want to automate. I tried with yes command but it is not there in ...
0
votes
1answer
4 views

Setting up a sublime symlink in Mac OS X while running pyenv

There are a lot of SO and links on how to setup a symlink so you can run sublime from the command line. But I'm running pyenv and it seems to have its own ~/.bash_profile as the real one doesn't have ...
-1
votes
1answer
17 views

Having trouble passing double quotes to dialog

I'm working on a script for automating audio recording, using the 'dialog' command to create an interactive menu to appropriately name channels. I've got a list of the channel names in an array. I ...
0
votes
1answer
36 views

Execute crontab as root not working

I need to execute a backup script each night. When I execute manually, backup is done without problems, but I use sudo crontab -e and add the script there: root@SF-DES-SVN:/home/svn# crontab -l # m h ...
1
vote
1answer
30 views

Command not working on shell but working on prompt

I am a newbie to Linux Shell Script. I want to change the IP address by Linux Shell Script and called by a PHP web application. I have finished my PHP web application and the shell script. Before ...
1
vote
1answer
22 views

Understanding Mac OS X indexing using “mdutil -E -i off /”

Two questions about mdutil and indexing: What is the -E option? It seems to me that it means something like "reindex" however the following bash command does not make sense to me mdutil -E -i off ...
2
votes
3answers
50 views

How to run Python script in a terminal window by double clicking it?

I am running OSX, and I am making an app that has a Python program in the Resources folder, the Bash script calls the Python script to run when the app is launched. The script is in the MacOS folder ...
3
votes
3answers
318 views

How to execute a second condition if the first condition is true in Linux shell scripting

I have an if condition. If that condition is true then one script will be run and after that I need to check another condition. How can I do that using an if statement or something else? For ...
-3
votes
1answer
32 views

Automatic start of processes in linux server if error found

please check below script . here "sanity" and "start" are the scripts . It will work ? please suggest > #!bin/bash > DATE=`date +%Y%m%d` > touch opt/logs_$DATE > sanity >> ...
0
votes
0answers
7 views

AFP share with local Unix users

I have a Solaris server on which I have a AFP share. I connect from a Mac client to that AFP share with local users from the Solaris server. So let's say I connect to the share with the Alice user. ...
2
votes
0answers
21 views

Enabling readline?

I have an .inputrc file set up on a system that doesn't seem to be respecting it. If I bind the file (as per this post) or try to load it with C-x C-r, nothing happens - I still do not get any of the ...
1
vote
0answers
17 views

ESC key does not work for whiptail on CentOS / Fedora

I have a problem with one of my shell scripts. The script starts with #!/bin/bash. It is an installation script using whiptail. I really need the 'ESC' key for at least a whiptail box using the ...
0
votes
0answers
20 views

Bash not working any more?

I was trying to install home brew (I am new to the command line and was following some tutorials on how to get up and running with github). So I was following this Unofficial Update Method: Compile ...
0
votes
0answers
5 views

Multiboot AD Binding Script Trouble (Error 10001)

So let's preface this with what I'm trying to do: I'm using DeployStudio to deploy multi-boot Macs, such as OSX10 and OSX09. My workflow goes like this upon Netbooting into the deployment server ...
-4
votes
0answers
9 views

find all webservers running http with no redirect to https

I'm trying to build a list of all servers that are running HTTP and not redirecting to HTTPS. Using the following nmap command to build the list: nmap -Pn -p80,8080 --open -oG webserver.txt ...
0
votes
3answers
43 views

Loop inside EOF - UNIX SCRIPTING

I am writing a script to automatic start up of an application whenever we found error in logs. so #/bin/bash if [ grep -c 'error' logs -eq 0 ] ;then exit else start <<EOF ## start is a ...
-2
votes
1answer
37 views

Join some files in bash

I have a task. I have to join files A:B.dsv, B:D.dsv and N:A.dsv. Column are separated by ':'. And I have to join by relation N:D. And sort end file by D. A:B.dsv: R0X 7M3:48B56 L6R 5X3:08P68 E1W ...
-3
votes
0answers
23 views

Study bash and awk. Where I can know bash and awk? [on hold]

Do you know where I can study bash and awk? I would like to a lot of exercise and example. Issues: bash awk grep join sort etc.
0
votes
1answer
58 views

/bin/bash is gone?

I typed the following command, and now bash isn't working. $ sudo chmod a-x /bin/bash_old /bin/sh_old It just says: login: /bin/bash: No such file or directory.
1
vote
1answer
23 views

Partition directories into subdirectories based on directory name

Background: a client's website stores user profile photos and other attachments into a single flat folder /user/images/*user_id*. They recently hit the directory limit (echo */ | wc echoes 31998, file ...
0
votes
1answer
18 views

FFMPEG merge consists of only one a single video instead of all of them

I am trying to merge several mp4 videos together in a folder. However, when I run the following script, sometimes only 1 video is in the output. For example, if I have video1, video2, video3, and ...
5
votes
1answer
64 views

Why does rsync read .bashrc and not .profile?

rsync is a non-interactive program that logs into other machines. It shouldn't need the init file for an interactive shell session, and it should absolutely need the init file for a login shell. Or so ...
-2
votes
1answer
27 views

using find and delete files/folder - with the exception of 1 folder - challenging

i want to use find and delete everything with the exception of one folder if found. e.g. [oracle@SJOAM test]$ ls -l total 4 -rw-r--r--. 1 oracle oinstall 0 Sep 2 02:05 a -rw-r--r--. 1 oracle ...
39
votes
3answers
4k views

What does this strange symbol “:>” in bash mean

I found something in a script, but not belonging to the main script. There was :> in a line. Could you explain to me what it means? :> file while read A B C D E; do echo "$A;$B;$D;$E;$C" ...
4
votes
2answers
212 views

Get curl to output non-2xx to stderr, but 2xxs to a file

I would like some curl command, possibly with some bash hackery, that: Outputs any 2xx responses to a file Outputs any non-2xx responses to stderr Exits with a nonzero status code when a non-2xx ...
-2
votes
0answers
19 views

How to move files and folders via DOS command [duplicate]

Can anyone suggest how can I achieve the task below, via DOS command or Windows batch file? I want to move all files and folders from source folder to destination folder. e.g. C:\source\file1.txt ...
0
votes
0answers
12 views

Cannot remap Control-<key> to another Control-<key> using .inputrc in bash + Terminal + OS X

I'm trying to remap Control-g to Control-c for use in bash in Terminal.app in OS X. This is because Control-g in Emacs is 'abort'/'cancel', and my ingrained muscle memory leads me to hit Control-g on ...
0
votes
0answers
9 views

How to enable arrow keys on vim used from msysgit bash

I just need a simple solution that will enable the arrow keys in the vim included with Git For Windows. I did found a solution to enable backspace. But no solution for the arrows problem. The arrows ...
0
votes
2answers
39 views

Pass variable from awk to bash

How can I pass variable from awk to bash? I want to pass a lot of variable, so I don't use: x=$(awk '.....) I thing it's not usefull.
1
vote
2answers
32 views

“read” works as expected in ZSH but behaves differently when using any other shell

I’ve written a short while-do cycle but I found it working strange with different shells. That's it: find "`pwd`" -type d | while read -r D; do ls ${D}; done When I start it using zsh, all goes ...
0
votes
1answer
25 views

Bash script to create a folder structure

I'm trying to write a Bash script to automate a recurring task, namely the creation of a structure of folders, where some of them should be numbered (To be more specific, this is meant to archive some ...
0
votes
1answer
25 views

Keyboard layout in Terminal of Red Hat Linux changes automatically

I have an unique problem in Terminal of Red Hat Linux WS 6.6. After some of period of period (Don't know exactly when..) keyboard layout (and not language) changes from German to English ONLY in ...
1
vote
1answer
17 views

Upstart: What is the first tracked PID w/o expect, but with script AND exec?

I have some Upstart configs used to start some foreground and blocking processes to run in the background as some kind of "daemons", especially those processes do not fork in any case. What I want is ...
-1
votes
2answers
50 views

bash No space left on device

On VPS when I press tab under my user I get: bash: cannot create temp file for here-document: No space left on device but it works fine under root, what's happening?
1
vote
0answers
30 views

Is it Possible to get list of commands i typed in dos prompt? [duplicate]

I would like to search my own CMD history. we could browse within the same session, you can browse it with the up and down arrow keys but what about the history of former CMD sessions? Is there a ...
1
vote
2answers
57 views

Kill all tasks with PID above a certain integer with bash

How may I fetch and kill all processes with a PID above e.g 1000? Using commands like ps -A and top is fine for viewing the list of processes, but how would one only get the PIDs? The logic of ...
0
votes
1answer
20 views

Execute command generated by a PHP script

I have PHP file which has logic based on which I run either bin/phpunit -c Application/app --testsuite $TESTSUITE or bin/phpunit -c Application/app --group group1 group2 when Im doing ...
0
votes
1answer
27 views

Problems running nmap export to file in linux as a cron job / bash script

I have a very simple bash script that runs nmap and exports the results to an xml file, and the uses scp to upload the file to a server: #!/bin/sh nmap -sn -oX /home/scan.xml 192.168.20.1-255 wait ...
-2
votes
1answer
38 views

bash: Loop over lines of a file

Here is my script: #! /bin/sh for line in $(cat list); do echo "[$line]: Getting my workers list.."; var=$line-"worker1"; echo "$var" >> "hostlistworkers.txt" ...
0
votes
1answer
15 views

Not able to set wallpaper after reboot through ~/.fehbg in .xinitrc in i3 on Arch Linux

I'm trying to set my wallpaper using an automated script in .xinitrc rather than having to set it after every reboot by myself. I've used feh to set the wallpaper. And then used the generated .fehbg ...
0
votes
1answer
12 views

Use disk-backed buffer between pipes

I'd like to pipe a command into a slower one, with a rather big (~200GB) buffer in between. Here is an example use-case: command1 | buffer -f file.buffer | command2 Is there a command to do that? ...
0
votes
1answer
20 views

Pipe string to a command with multiple read prompts

How can I pipe a string to a command with multiple read prompts in OS X? I am running a command for a Parallels VM to enable a password which prompts for multiple values (without running a secondary ...
0
votes
1answer
19 views

how to grep something with a wildcard path?

I want to grep a Gemfile in few rails apps. But for each rails app there are many branches and out of which the latest branch name lets say is 'main'. The structure is something like this: workspace ...
0
votes
1answer
33 views

Sort file by two column in the event of two the same value

I want to sort files by one column, but in the event of two the same value I want to sort these two by other column. How can I do it? My file: 1 2 3 1 3 2 1 4 3 2 4 1 2 1 3 3 1 ...
1
vote
0answers
52 views

How to configure .bashrc for git-for-windows?

I used Git Bash for Windows with Version 1.9.5 on my Windows 7 (64bit). I added a .bashrc and a .gitconfig in my %USERPROFILE% folder (C:\Users\<USERNAME>\). Everything worked fine. Now i ...
0
votes
3answers
25 views

formatting output in bash shell to remove special characters - linux

I am issuing the command below against a logfile grep "Oracle Audit" /var/adm/messages | awk '{print $6}' How do I format the below output Audit[9460]: Audit[10507]: Audit[10507]: Audit[10507]: ...
0
votes
0answers
11 views

Canvas lms open sourse installation

Hope you are doing fine. I am facing a lot of problem while configuring canvas using ubuntu 14.04 following the steps described in https://github.com/instructure/canvas-lms/wiki/Quick-Start Step 1: ...
1
vote
1answer
27 views

How to color specific parts of the bash prompt?

I am working on a macbook OSX and I am administering some VMs inside my machine. I often make mistakes because all prompts have the same color and type, so I want to differentiate them. First of all, ...
1
vote
1answer
38 views

Incorrect output of history command of ssh. How to read the timestamp info correctly

I set the HISTTIMEFORMAT variable to store the timestamp info .bash_history file. I am able to display the history properly if I use interactive shell. But, when I run history command to display ...