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

learn more… | top users | synonyms

0
votes
0answers
14 views

Make a script identify DBUS session address and use it

I'm using cron with notify-send to display some notifications, but it requires DBUS session to run Here is the script: export DBUS_SESSION_BUS_ADDRESS=[session] #!/bin/sh { DISPLAY=:0 ...
0
votes
1answer
30 views

What is the sequence of files bash loads to set PATH variable

I want to understand the way PATH variable is set in Linux/Mac. What all files are loaded and in what sequence to set the PATH variable for BASH.
2
votes
1answer
36 views

Automated conversion of .dvdmedia(VOBs) to format Plex can handle on a Mac?

I'm super impressed by Plex, and I'd like to convert all my old dvdmedia files into a format that it can understand. I have quite a few of them (the product of a dvd library being ripped to work with ...
0
votes
2answers
16 views

batch rename multiple mp3's stripping leading digits

Hi could anyone help me? Im trying to strip leading digits from multiple mp3 files so "01 some_file.mp3" would become "some_file.mp3" if any one could show me how to doit with zmv that would be great
0
votes
1answer
14 views

Backing up github [closed]

I have a bunch of github directories and have been using a script with the "cp" command to backup to an external USB drive. I was wondering if I should be backing up directories that I make for ...
2
votes
0answers
28 views

Cannot Stat Error When Copying From Android Phone to Ubuntu 13.10

I am trying to move a video file from my phone to my harddrive via a script and am running into trouble with permissions. I am using the following command: sudo cp ...
0
votes
0answers
20 views

Start terminator terminal in a free spot on my screen

When I start the default Ubuntu terminal, it automatically puts the new terminal in a spot on the screen where no other terminals are there. Now I set terminator as my default terminal. But whenever ...
1
vote
4answers
38 views

Check which string occurs first in a growing file

I'm running a remote executable which produces a logfile. I want to write a script to check whether the executable is run successfully or encounters an error. The way I can do this is by looking at ...
0
votes
1answer
24 views

Change value in config without opening

Is it possible to change/uncomment value in linux configs without opening and go to line? Example: In php.ini we had expose_php = On and we want turn it off: $: magic_cmd "expose_php = Off"
0
votes
2answers
57 views

Unable to create a permanent alias in Mac OS

In Linux I can well to add alias to bashrc and it will become a permanent alias. In Mac OS I tried to do the same thing: vim ~/.bashrc export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH f or ...
0
votes
1answer
37 views

Commenting out a line in Bash script based on variable

I'm not programmer and I'm trying to make my first script. I have: # NOMBREX1:lalalala # NOMBREX2:0 if [ "$NOMBREX2" == "0" ]; then ?????? fi $COMMENT1 rar a -r ......... If NOMBREX2=0 I ...
1
vote
1answer
20 views

Pipeing lines to repeat commands

If my grep operation returns a list of ID's like: 12345 84758 49549 .. can I somehow feed/pipe each line to a commandline command's parameter? Like for example with the above result from grep, I'd ...
0
votes
2answers
46 views

Properly escaping forward slash in bash script for usage with sed

I'm trying to determine the size of the files that would be newly copied when syncing two folders by running rsync in dry mode and then summing up the sizes of the files listed in the output of rsync. ...
0
votes
1answer
35 views

MAC - edit hosts file in bash script

I have some VM stuff set up in my mamp instance, I'm using wp-cli in a bash to install wordpress instances, I wanted to add to this script a command to edit the hosts file based on a var. sudo echo ...
0
votes
1answer
32 views

List all conversations in Pidgin for one day

I got a lot of messages yesterday while I was working on something else so I couldn't read them. Then unfortunately my Ubuntu-machine restarted before I could see who was writing there. I guess The ...
0
votes
1answer
27 views

Search a string between two timestamps starting from bottom of file

I was trying to find a string Cannot proceed: the cube has no data in huge test.txt file only between timestamps yesterday 22:30 pm to today 00:30 am. Script: tac test.txt | awk -v today=$(date ...
0
votes
1answer
27 views

Sudo as www-data, unable to cd

I have a .procmailrc setup which pipes emails into a script. The core of my problem is that the email is received as user 'magic', and the script that I need to process the email needs to be run as ...
0
votes
1answer
29 views

How to prevent terminating command to send EOF to named pipes?

The problem I faced is exactly this one: http://www.linuxmisc.com/4-linux/d7863c256bccbfb6.htm I want to be able to run a program which takes stdin, and write data to it whenever I feel like ...
0
votes
1answer
25 views

Converting multiple files using programs that accepts stdin and output to stdout

I want to convert a list of files in a directory to another directory using some preprocessing programs. I know I can do this for one file: cat "$INDIR/$file" | ./program > "$OUTDIR/$file" And ...
1
vote
1answer
23 views

Ask for password once during dotfile installation

Similar to this question, I'm making dotfiles for setup of a fresh OS X machine. It asks for my password multiple times, since install & system setting sudo commands are in several nested scripts. ...
1
vote
0answers
25 views

Recursive search occurs instead of last command when using up arrow.

I'm using an internal product "shell" based on spring shell. When I press the up arrow to get my last command, instead I get (reverse-i-search)`': Retrieving the last command works for all my ...
1
vote
1answer
39 views

Unable to delete a file using bash script

I'm having problems removing a file in a bash script. I saw the other post with the same problem but none of those solutions solved my problem. The bash script is an OP5 surveillance check and it ...
0
votes
0answers
9 views

Meta keybindings for bash readline from .inputrc not working

If I put "\M-p": previous-history into my .inputrc and fire up a terminal (urxvt or xterm), hitting Alt-p prints a ":" character. Subsequent hits produce ^[p like so: :^[p^[p^[p^[p^[p I would ...
0
votes
2answers
32 views

Is there a unix command to output time elapsed during a command?

I love using time to find out how long a command took to execute but when dealing with commands that execute sub-commands internally (and provide output that allows you to tell when each of those ...
0
votes
3answers
32 views

remove lines with duplicate words

I have a sorted file with lines like this word1 abca word1 abcb word1 abcc word2 abca word2 abcb word3 abbb ........... and i want to have something like this word1 abca word2 abca word3 ...
0
votes
0answers
22 views

ls inside bash script didn't found just created file

bash script contains like: ./java_application ls logs/app.log java_application deletes and creates new log file: app.log when I run this bash script I receive: ls: logs/app.log No such file or ...
0
votes
2answers
35 views

Empty /var/log after running cron bash script

I wrote a little bash script and all of a sudden my /var/log folder is completely empty except for the log I created for the bash script. This is the script I'm running every hour with cron: ...
0
votes
1answer
13 views

How to get nmap to show ftp banner / welcome message?

What are the commands to get nmap to show ftp banner responses?
0
votes
3answers
29 views

Make sure command entered is Read Only

I am creating an API that takes in any command (in bash) and executes it at the root. I want to ensure this command is RO and does not write anything. Any ideas of how to go about this? Maybe it can ...
0
votes
2answers
18 views

confused about variables in bash

I know that variables in bash have no type, but am confused about the value they are assigned. The following simple script works fine in bash #!/bin/bash tail -n +2 /cygdrive/c/workdir\ \(newco\,\ ...
0
votes
1answer
41 views

WGET/cron downloading webcamera file

our new town doctor put a web camera to his waiting room for people to see how much crowded it is. As my mom and grandparents go to this doctor, I wanted to download the files periodically and if they ...
2
votes
0answers
39 views

How to register shutdown script on Amazon Linux in AWS EC2

I am using Amazon Linux (RH-based distro) in AWS EC2. I followed the structure of /usr/share/doc/initscripts-*/sysvinitfiles to create an init script in /etc/init.d. /etc/init.d/do_something ...
0
votes
2answers
57 views

How do I determine in a shell script if a FTP host is up? [closed]

I need help writing a for loop to work with ftp. It needs to get its input from a text file of addresses. The scipt does not need to fully connect, just show if host is up or not. what I got so far: ...
1
vote
1answer
34 views

Can I use Cygwin as a replacement for Ubuntu, for bash script testing?

Next wednesday i'm having an exam on Operating Systems. In this exam there will also be a part bash-scripting. The teacher itself will test the scripts in a Virtual Machine running Ubuntu. Myself, ...
-2
votes
3answers
59 views

osx bash grep - finding search terms in a large file with one single line

Is there simple unix command line i can enter which lets me isolate say 512 bytes either side of a search term, even if there is only one "line" in a very large text file? Ok, this should be easy. ...
1
vote
2answers
23 views

How to make it so bash runs instead of asking where to run upon selection from file navigator

When I double-click on bash files on Linux Mint a pop-up appears querying whether I want to run in terminal, display, run, or cancel. I was wondering, how do I make it so for this particular bash file ...
2
votes
3answers
174 views

What exactly do the sudo -s command? and how is it used in this example?

I have the following doubt. In a tutorial related to a software installation that I am following say that I have to execute the following commands (I am doing it into an ssh shell, so this list of ...
0
votes
0answers
33 views

Why is there a bash process running in my Terminal if I use Zsh?

When I run the "top" command on OSX Mavericks, a bash process appears even though I am using Zsh, why?
-1
votes
2answers
25 views

What is the risk when editing crontab file without the “crontab -e” command?

I developed a script in which I add lines to the crontab file with echo command and I remove lines with sed command. I do not know the risk of that especially that I find in some web site that we ...
1
vote
1answer
17 views

Is there any way to redraw the text in a terminal window after resizing it?

Just a usability question really. You know when you are working in a terminal window and you decide to do some query that brings back a wall of text and you think to yourself... "that would be easier ...
-1
votes
1answer
30 views

bash script with lftp with redirected input

I need lftp to connect to a list of hosts from a list file which are in IP address format. Then, if a ftp server is up, log that address (and if possible, device type, in this case routers) to a text ...
0
votes
0answers
23 views

Logging/debugging the bash startup process

My bash shell sometimes takes quite a while to start, probably due to a lot of stuff happening in my various dot files (e.g. .bash_profile, etc.). Is there any way to properly log the bash startup ...
1
vote
0answers
25 views

Dtrace shows posix_spawn called with only 3 argument. Trying to launch by hand

I ran dtruss on a process that launches another one: the League of Legends Launcher starts the main game process with certain arguments that I can't seem to pass via the command line. What caught my ...
0
votes
1answer
24 views

bash scripting, run commands in all subfolders with selections

I need to run this command trjconv -s run.tpr -f run.xtc -pbc mol -ur compact -o unwrap for all the sub-directories following the naming pattern of us_0.0, us_-0.2, us_-0.4 ... us_-3.8. The ...
1
vote
2answers
71 views

Use alias source with relative path

I want to add an alias file to my project folder to quickly open and edit files in it with a simple shell command. To make it more portable, I would like to use only relative paths. I want something ...
1
vote
1answer
35 views

How can I determine via command-line if VBox Guest Additions has been installed?

In particular, I need to know in order to write a bash script to prompt the user to install VBox Guest Additions on a Ubuntu client if it hasn't already been installed.
0
votes
0answers
36 views

Detaching from a GNU Screen suddenly clears the terminal

I feel so stupid for asking this, but here goes: I updated my Ubuntu (Server) install today from 13.10 to 14.04. Before the upgrade detaching from screen did not clear the terminal and now it does. ...
0
votes
1answer
25 views

Removing files and directories that already exist in other directories

I need a help writing a script. So basically I have directories named by current date, like 01-06-2014 02-06-2014 and so on each of these directories has files and subdirectories inside. But sometimes ...
0
votes
0answers
21 views

Warning: the connection is closed, while running cron job

I have found on the Internet simple script to download wallpaper from bing and set it. #!/bin/bash # export DBUS_SESSION_BUS_ADDRESS environment variable useful when the script is set as a cron job ...
0
votes
2answers
36 views

Using a parameter multiple times in a single line bash command [duplicate]

I occasionally need to run a command such as: mv "very-long-file-name.x" "very-long-file-name.y" I would like to achieve this without repeating the very long file name twice... I know how to do ...