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

learn more… | top users | synonyms

0
votes
0answers
2 views

How to configure AWS EC2 user data values and bash script

When launching a AWS EC2 instance, you can give a user data string that is interpreted either as key, value pairs with some configuration variables, or as a bash script, if it begins with a #!/bin/...
0
votes
2answers
26 views

How can function definition be part of pipe sequence in POSIX shell grammar?

The POSIX shell grammar at http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02 says pipe_sequence : command | ...
0
votes
0answers
7 views

How do I get bash history for users running commands via PHP shell_exec()?

Is there a .bash_history or something similar stored out of memory when running shell commands via PHP's shell_exec() or backticks? PHP is running Cloudlinux+FPM multi-tenant where each user owns its ...
0
votes
0answers
4 views

Installing NS2 under Ubuntu

I'm trying to install NS2 on Ubuntu 14.04. I followed the steps that are recommended and in this answer. But I'm still facing lots of errors. /home/smallko/ns-allinone-2.28/sgb/gb_io.w:576: undefined ...
3
votes
1answer
16 views

bash find list of archived files with wildcard in while loop

I have a few thousand gzipped text files in different subdirectories and used a subset of these files as input for a project a few years ago. Back then I had an unzipped copy of the files I actually ...
0
votes
1answer
27 views

How to convert date from number format to String format?

My input is [10/04/16 01:02:03 BST].How can I convert to Apr 10 16 01:02:03? And I dont want to replace / to-.
0
votes
1answer
16 views

Rezip file without creating temporaries

Maybe it's best I just start off with the use case. I have a large zip file full of many files and I suspect it was originally zipped at a low compression level. I want to create a new zip file from ...
1
vote
1answer
17 views

Bash move and rename by parsing the output of find

I have nested directories of pdf files and I would like to extract them to a higher level directory renaming them as follows: My files are something like: ./path1/pathA/fileI.pdf ./path1/pathB/...
0
votes
0answers
10 views

How to force dialog windows to be displayed in front?

When I open a zenity dialog window with bash, the window is always displayed in the background rather than in front of the terminal window. For example zenity --info --title='Just a title' --text='...
0
votes
2answers
26 views

How do you re-source the environment variables in a command prompt in Windows?

In a bash shell, you can edit your environment variables, run source ./.bashrc and refresh the values of environment variables in an already open shell. Does Windows have a similar command that you ...
-1
votes
1answer
10 views

How can I filter a list of files to download those that don't already exist?

I have downloaded some files into a folder, but the download was interrupted and not all the files were downloaded. I do not want to redownload the gigabytes-worth of files I already have; I now want ...
0
votes
1answer
18 views

Last background process ID ($!) not working in sudo bash command

Do shell variables work inside sudo executed commands? I'm trying to run, and later kill, a background process, as another user inside a script. However, I cannot capture the background process ID, ...
1
vote
1answer
32 views

How to kill a daemon in Linux?

Note: Before you mark this question as duplicate, please note that I've tried all the solutions that I could get online, but still I'm unable to resolve the problem. I ran daemon through the ...
1
vote
1answer
18 views

bash xargs: same command gives different output

When I run ls -1 *.a | xargs -I{} echo {} | sed 's/.a//' The output is 1 2 3 When I run ls -1 *.a | xargs -I{} bash -c "echo {} $(echo {} | sed 's/.a//')" and the output is 1.a 1.a 2.a 2.a 3....
0
votes
1answer
12 views

Passing array values to command args

I’m trying to write a script which executes a command to each of the elements of an array, independently of the number of values in it. However, the only solution I come up with is the following (made ...
1
vote
2answers
27 views

gunzip multiple archives to specific folder

is there possibility to gunzip multiple files into one folder? I have alot of access logs which I need to exctract do folder. There placed in /var/log/nginx/ and they are named like access.log.2.gz ...
0
votes
0answers
13 views

Run multiple Synergy servers

Currently I have a Windows PC & Linux workstation running Synergy. One is the client and the other is the server with the physical keyboard and mouse. I was wondering if it is possible to add ...
2
votes
1answer
14 views

Passing variables into ssh sessions (Session has to stay alive)

is it possible to start a ssh remote session and pass a variable to the remote host, which is usable in the opened session. For Example: Client: testvar="this is my text" Open ssh session (ssh user@...
0
votes
1answer
11 views

Shell script fails when executed by systemd service

So I have a systemd service called startup.service: [Unit] Description=startup scripts [Service] Type=oneshot ExecStart=/home/user/Documents/Tools/Scripts/startup.sh [Install] WantedBy=multi-user....
0
votes
1answer
13 views

Difficulty getting /etc/rc.d/init.d tomcat startup script working

I have the following startup script that on reboot does not bring up tomcat: #!/bin/bash # # description: Apache Tomcat init script # processname: tomcat # chkconfig: 234 20 80 # ### BEGIN INIT INFO #...
0
votes
1answer
21 views

create firefox profile in virtual terminal

As part of a system setup process, I'm trying to create a default firefox profile on the command line using firefox -CreateProfile default and then proceed to customize settings, etc. This works ...
0
votes
2answers
30 views

Bash - sort by not first character

I want to sort my file by first column but I have to start sort from 5 character. How can I do that? My file: "TTTTCTTACA" 1 1 "TTTTCTTACC" 1 "TTTTCTTACT" 1 ...
0
votes
0answers
12 views

Simple User Interface for video Interview [closed]

I would like to prepare a system to make interview at a party. Description of the interview We have a close room with a chair and a MacBookPro. Users come whenever it is free and record themselves ...
1
vote
1answer
21 views

Camel-casing a 'dashed' string

I'm fairly inexperienced with *nix scripting, and I have a need to take a string with lowercase words separated by dashes and convert that to a new string with the dashes removed, and the first letter ...
1
vote
2answers
25 views

Can I delete only the first matching line using sed?

I have a file testfile.txt containing pippo=x pluto=y 1234=z I'd like to delete only the first line matching /^[a-z]\+=/ (the first line in this example). I've tried with the following command but ...
0
votes
1answer
12 views

Use netcat to bridge thru firewall?

I have a machine behind a firewall. It's my machine, I have set up ssh, but it's completely firewalled. My solution has been to use a reverse shell set up on a cron basis to reconnect if it fails ...
0
votes
2answers
31 views

cygwin bash - if statement doesn't work

I'm new to bash scripting, and I'm trying to learn on Windows, so I downloaded cygwin. Using Windows 10, cygwin v2.5.1 I made sure I installed the bash package (I did), and so I started going through ...
0
votes
1answer
13 views

tmux does not trigger when placed in rc.local

I want to start a tmux on boot on a raspberry pi - 2. I have written a session.sh file and I have places it in ~/bin/ file which is in the home directory. This ~/bin/ is also included in the $PATH and ...
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 ...
2
votes
1answer
22 views

How to delete a file from a command in a shell file for /etc/init.d?

I have a about question working with /etc/init.d shell script. All I want to do is delete a file from a command inside the shell script like so: case $1 in stop) echo "Stopping" rm -f /var/run/...
-1
votes
1answer
27 views

high priority for I/O operations

I came across this: http://linux.die.net/man/1/ionice however, it seems that it is not working on os x, as i got message that command not found. is there any alternative to it or way to install ...
1
vote
1answer
55 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
votes
1answer
18 views

Spotlight now treating bash scripts as 'Document' instead of 'unix executable'

I have a directory of bash scripts I use frequently, and I tend to launch these via Alfred Alfred in turn relies on Spotlight to index scripts, and assign them a meta content type of 'public.unix-...
1
vote
0answers
20 views

Find windows program pid with its path

I want to kill a program with a windows bash script.I need to find the pid of a program with its path.we have three different directories with same program on a computer.We start all program all of ...
0
votes
0answers
8 views

Reverse search in PowerShell ISE wanted

In Bash, you can reverse search your history using Ctrl-R and start typing. Is there a similar feature in Windows PowerShell ISE?
0
votes
2answers
58 views

Importing variables in one shell script from another without executing the referred shell script

I have 2 shell scripts, file1.sh and file2.sh file1.sh #!/usr/bin/env bash export var1="/data/share" export var2='password' echo "Hello" file2.sh #!/usr/bin/env bash source file1.sh echo $var1 ...
0
votes
1answer
16 views

Check MD5 of a file header hosted on a webserver

I am writing a bash script to periodically download a setup file using cURL. The problem is the following, the file is around 110 MB and always have the same filename. I can download the file, check ...
0
votes
1answer
14 views

nohup on bash redhat is one processID different

I'm using capistrano to deploy a python service. I was trying to both start the service and also write a pidfile, so I can restart the service or stop the service later. The problem is the pidfile is ...
0
votes
2answers
12 views

How to terminate a cli app when stdout contains a certain string?

I've got a command line app that outputs lots of information to stdout. How can I terminate the program when stdout contains a certain string? e.g. something like: my_program | ...
1
vote
1answer
28 views

Check if a script completed executing instead of exiting

I'm working with a script that I cannot modify, that does not use exit codes. (all exits are simply 'exit') Without modifying the script (or yelling at the idiots who wrote it), is there a way to ...
1
vote
1answer
33 views

Disable autocomplete hints on iTerm2

I would like to disable the autocomplete history things that come up on the iTerm, as shown in the picture below: I would like to get rid of the blue hint that comes up when I start typing a ...
1
vote
0answers
42 views

Speedup zsh startup time

I'm on MacOS 10.11. When I open a new tab on Iterm2, it takes almost 2 second to have the prompt. So I guess I have something in .zshrc / .bash_profile / .bashrc that takes times to load. Here are ...
1
vote
0answers
13 views

Bash&TMUX - Continue after error

I want to write a bash script which opens new window in certain tmux session, runs another script in it and then closes. The problem is, if I launch two instances of the script, I want the script to ...
0
votes
1answer
52 views

How to extract specific data from the table?

Here is the table... Group Name Designation 2 (John) Front End Developer 12 (Jim) Back End Developer 8 (Jill) Full Stack Developer 21 (...
0
votes
1answer
13 views

Create a select list of users in Bash on OS X

I am trying to create a copy script to quickly copy a user folder in OS X, while excluding all the junk (caches, old iPhone Backups, logs, etc.). As far as not copying those files/folders I am not ...
1
vote
2answers
27 views

What is the equivalent of Linux's (bashe's actually) “&>” in Windows?

How can I redirect (to one file) stdin and stderr of the program? I look for something like &> in bash for Windows.
0
votes
1answer
15 views

Reset Cache using bash

I'm trying to automate a .sh file to run every time before Chrome opens, here's what I want to do. rm -rf /home/pi/.config/chromium tar -cvf reseterfiles.tgz /home/pi/.config/ The zipped ...
1
vote
1answer
19 views

How to 'set -x' for scripts other than my own

I am still dealing with a bug from another question which has gone unanswered because I can't get debugging information. I have scripts running other scripts and I need to see how the tty is getting ...
0
votes
1answer
44 views

how to mount chroot /proc on ubuntu start

In order to run java inside chroot environment I have to mount /proc file system using the following command mount -t proc none /proc inside the chroot environment or mount -o bind /proc /path/to/...
1
vote
1answer
59 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 ...