Tagged Questions

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

learn more… | top users | synonyms

0
votes
1answer
30 views

Create domain glassfish

I'm trying create a domain on glassfish. but, when I execute the command: create-domain --adminport 4848 domain1 I get this message: /exports/home/admapps/cf.out (No such file or directory) Disk ...
4
votes
1answer
739 views

Do I need to be concerned using the Git Bash on Windows with Shellshock?

I use the Git Bash on a Windows 8.1 machine. Do I need to be concerned by Shellshock?
0
votes
1answer
23 views

is it possible to allow only root user to create Environment variable?

We know , Linux world right now watching on Bash bug with environment variables. So , I just want to know If we can make something like only root user can create environment variables and all other ...
1
vote
1answer
45 views

Bash - list files within date range

So far I've been basing my efforts around this blog and have come up with: startdate=”201407010000? enddate=”201408010000? touch -t $startdate ./startdatefiles touch -t $enddate ./enddatefiles find ...
1
vote
0answers
87 views

How to remove file when over quota without root permissions and truncate, dd, mv, cp, and rm fail?

I'm working on a file system where I don't have root permissions and all of the above have failed to allow me to delete a file with the same errors: $ >file1 $ -bash: file1: Disk quota exceeded $ ...
0
votes
3answers
72 views

Is it possible to get the download file name of an mp3 from server using bash?

I am trying to get the final download file name of an mp3 from a server, specifically audiotool.com e.g. http://api.audiotool.com/track/haunt_opaque/mixdown.mp3 When you navigate to this url in a ...
1
vote
1answer
51 views

how to use fzf on Mac Terminal with bash

I found a utility called fzf https://github.com/junegunn/fzf which is a fuzzy-finder for your shell. Two questions: 1) After I run fzf and run a file, I press Enter and then the file I found is ...
0
votes
0answers
25 views

How to use bash to open several terminal instances

My current setup involves starting my computer up, loading several terminal instances, resizing them to fit in a grid, then loading a command on each to watch output Is there a way where I can set up ...
0
votes
0answers
23 views

Windows .bat or .sh file to prepare multiple repositories for sourcetree

What I am looking to do is run a script that will: delete folders a,b and c from a directory. re-create the folders a,b and c as a a local git repository (using their individual git source urls) ...
0
votes
1answer
279 views

Bash: exact match of a string with regex

I have to do an exact match on a string with a regex. i have to realize this pattern: toCheck must start with 2 occurrence of $str1, with max 1 occurrence of $str2. If toCheck match the pattern, i ...
0
votes
2answers
106 views

Bash script: Use variable in sed to delete all but the last “x” lines of a file

i'm using the following bash script to delete all but the last 'x' lines in a log file: #!/bin/bash # Script to write to the log file every minute and delete all but the last # set time in hours ...
0
votes
2answers
31 views

How to make a copy of file in the same directory

This creates a file in the same directy as 'some.file.bak'. find /home/ -ipath "*/temp/some.file" -type f -exec cp {} {}.bak \; How to make a copy in another name such as 'another.file' in the ...
0
votes
1answer
25 views

Return / transform then return pattern with nulls

I'm using grep/sed to parse a large binary file full of nulls for some specific data. This is in a windows environment using gnuwin32. Assuming I had some to return some data from a binary file that ...
-1
votes
3answers
1k views

How do I build bash to patch against shellshock and test it before installing it at the root of my system?

What seems to be wrong with my code below? I'm downloading and patching up to patch 18 which I understand is the patch for shellchock vulnerability. But I still get the vulnerability when running ...
0
votes
1answer
49 views

Redirect output to file, then write sentence with exit code to end of same file

I am looking to redirect all the output from a python script to output.out, then upon completion of the python script, write Exited with code: <EXIT CODE HERE> to the same file where <EXIT ...
0
votes
1answer
47 views

How to get crontab to run when backup requires a password

I am running a script to backup my postgres database on Debian. I am basically running exactly this: https://wiki.postgresql.org/wiki/Automated_Backup_on_Linux Now I have everything working fine when ...
0
votes
1answer
184 views

unable to execute: Too many levels of symbolic links

By mistake, I executed these commands : sudo ln -sf bash /bin/sh sudo ln -sf bash /bin/bash When I rebooted the Linux server in recovery mode I got this message: init : Failed to spawn ...
0
votes
0answers
194 views

What exactly is the “Shellshock” vulnerability?

Concerning the Shellshock bug (aka "bash bug", CVE-2014-6271), can someone explain how this vulnerability works? Based on the test given in some posts (below), it looks like some type of injection ...
39
votes
4answers
7k views

Does the Shellshock bug affect ZSH?

Does the Shellshock Bash bug affect ZSH? Is upgrading Bash the only solution?
1
vote
1answer
24 views

Double quotes in Linux script

I'm trying to create a script that moves to a specific folder, then renames and moves all files to another location. However, I'm getting an error at the end of the JHEAD command because of the space ...
0
votes
0answers
32 views

Maintain screen session when executing shell script on boot

On Ubuntu 14.04, I have a crontab entry set to run on reboot: @reboot /root/start_server.sh And here's start_server.sh: screen -dmS server bash -c "cd server ; ./run.sh" When the system starts ...
0
votes
1answer
347 views

Is Bash part of Apple's OS X System Update?

I think the title is self explanatory. How safe is it to upgrade yourself using methods such as this (https://coderwall.com/p/dmuxma)? Thank you in advance.
0
votes
0answers
24 views

Windows right click on git bash menu, report can not find sh

i am able to open Git Bash from the program, but right click on drop down menu 'git bash' it says can not find sh. How can I fix this problem?
0
votes
1answer
36 views

How to copy a list files to a list of directories or subdirectories

I'm trying to figure out how to copy a list of files to a list of subdirectories. eg. I have 300 files to copy into 300 subdirectories - 1 to 1. file1 -> dir1/sub file2 -> dir2/sub file3 ...
0
votes
1answer
12 views

Bash expansion to list from a directory

I tend to work on multiple projects, all stored inside my home (~) directory inside a directory called web. At one point all my projects were inside a single directory inside this; so to move from ...
1
vote
1answer
29 views

7z from bash script won't exclude directories

I've encountered with kinda strange behaviour of 7z (or bash, I don't know yet.). With the following script: #!/bin/bash find /home/user -type f -name "*.pdf" | cut -c 10- > ...
0
votes
1answer
36 views

word boundary in a awk command not working when printing a range of lines

I am attempting to parse samba .conf file for a specific share section... [CMI] oplocks = no wide links = no writeable = yes delete readonly = yes path = /LOCALSITE/CMI ...
0
votes
1answer
13 views

OS X bash - make Shift-TAB work to reverse cycle possible matches

The answer here is great: Is there a way to make bash more TAB friendly? But is there any way to make Shift-TAB key work as well - so it does work in reversed direction?
0
votes
1answer
13 views

Iterate over files, ignoring filenames with a hyphen

Background Converting images from RGB to grayscale. A number of files exist in different directories. For example: outline/trigon.png outline/oval-bw.png outline/crescent-bw.png ...
0
votes
3answers
42 views

How to run a BASH script in response to a network event?

I've got a little BASH script I'd like to run on a few Mac's (A mix of 10.8.5 and 10.9.4). I'd like to trigger the script whenever my mac attempts to connect to another one through a particular TCP ...
0
votes
1answer
19 views

Add option to GDM 3.x that does not have gui

You know how when you login with GDM, and you can select a variety of desktop environments? For instance, mine has Cinnamon, GNOME 3, xfce. How could I add an option that logs you in without a gui? ...
2
votes
1answer
65 views

How to diff the redirection of two commands in a shell script

in the command line I can diff the output of two commands with $ diff <(cmd1) <(cmd2) but if I put this in a shell script $ sh do_two_comands_diff.sh It does not work $ diff <(ls) ...
0
votes
0answers
19 views

Call script from a bash-initialized clean environment

So I've got an executable with conflicting dependencies with the build system it is running in. (AKA Xilinx doesn't play well with others). I'd love to run a cmake script as part of the build process, ...
1
vote
0answers
20 views

get in a command-line process with pid [duplicate]

is there a way to get in a command-line process with it's PID for example I started apt on a terminal and launched a new terminal is there a way to transfer the output to the new terminal with the ...
0
votes
3answers
130 views

Time Zone is getting different over ssh command & normal ssh

Whenever I run a date command over SSH the timezone shows different and if I login to server with SSH and if I run the same command it is completely different. Running command with SSH >ssh ...
0
votes
0answers
28 views

Clean Mavericks Install: Bash and Environment Defaults?

Broadly: what are the default files in play on a clean OS X install when using environment variables and bash? What derives from root, and what from the local user? I always get turned around on ...
0
votes
0answers
11 views

CygWin shortcut to launch server, connect and start a program

I have miraculously only spent about 20 minutes getting an installation of cygwin to communicate with a remote box that I use for controlling my CNC machine. At this point, to get everything running ...
2
votes
1answer
29 views

Easily print out a spaces between larger data outputs in bash

I'm grepping through a very large web directory, and when I do multiple greps in a row, when scrolling up, it is difficult to tell when one result ends and an other one starts. I tried just clear, ...
0
votes
1answer
72 views

Temporarily switch Java version in bash script- Ubuntu Linux

I'm using the Java keytool as part of a larger bash script. I need to pass in a password to create a keystore, so used the command keytool -importkeystore -deststorepass:file ${somefile}. This ...
1
vote
1answer
65 views

Script to reference another file first

Hi I have a script and in it I need to get the hostnames from IPs that the script generates. The script will generate those IPs into 1 neat file with only 1 column. It is literally just IP address (1 ...
0
votes
1answer
23 views

Setting Terminal tab to current directory and program running

How can I make the terminal tab display <name of process running (vim, bash, ruby, etc)> - <parent directory/current directory>?
1
vote
1answer
47 views

How to view two dialog boxes on the linux console, running on the same time?

I want to view on the Linux console two dialog windows on the same time. I want a window that views the progress BAR, and the a second tailbox that view the logs are running. The problem is that the ...
0
votes
4answers
27 views

How do I close stdin in a shell script?

I have a misbehaving program that I need to call from my script. It exits as soon as it sees something on stdin. Is there a way to close stdin?
2
votes
2answers
31 views

One-line code in bashrc to edit pdf

I would like to have a one-line code in bashrc, for removing the first page of a pdf. The command to be typed in the bash prompt could of the form: cut name.pdf This command should remove the ...
2
votes
1answer
96 views

Timer running under bash script in dialog window

The following bash script is an example on how to use the dialog command. This script runs a progress bar (and displays the process upgrade). What is missing in the dialog is a time clock - that ...
0
votes
1answer
18 views

Light way to read big bz2 compressed files

bzcat *.log | sed # etc works but since the files are few gb big, it takes time to complete. Is there a way to do it in a faster way ? I tried echo *.log | xargs -P 4 bzcat | sed # etc but the ...
0
votes
1answer
39 views

Bash scripts are not working but on mac terminal those commands in scripts works

I'm stuck with a wired problem.My bash scripts are not working now.It worked previously.I don't know why.Interestingly the commands on the script work when I enter it directly on the terminal. This a ...
0
votes
2answers
299 views

Shell script to SFTP file to remote server

This is probably a question asked before, but I can't find a good question/answer. I need to write a shell script that will be called by PHP program (exec function) to move all *.pdf files to a remote ...
2
votes
1answer
46 views

How to change BASH “editing-mode vi” shortcuts?

I'm trying to change my bash vi mode keys to enter and exit insert mode, I would like to set these shortcuts: Ctrl-\ : Enter moviment mode Alt-\ : Enter insert mode how can I do that? I'm trying ...
2
votes
2answers
76 views

Recursively fixing image file extensions in Linux

I have a bunch of image files from misnamed scans/faxes I need to fix for our Linux users. It turns out we have a bunch of scans that are PNG files that are labled as *.jpg visa versa. Under Windows ...