3
votes
1answer
36 views

Openbox pipe-menu script error

This is the weirdest thing. The script works when run from the shell with no problems. When I run it as an Openbox pipe-menu I get the error "Invalid output from pipe-menu". After playing around with ...
2
votes
2answers
25 views

Writing content from a file to another file on set time intervals using delimiters

I'm trying to write a script in bash that reads a file file1 and writes to another file file2 every 2 seconds, which is easy enough. However, I want to write to file2 on either a line by line basis ...
0
votes
1answer
63 views

Writing a shell script in Ubuntu to process several layers as a single animated GIF file [duplicate]

I am an Ubuntu 12.04.4 LTS 32-bit user and I would like to automate the process of opening several PNG images as layers then saving these layers as a single animated GIF file in the GUI of GIMP. My ...
2
votes
2answers
106 views

inotifywait different action on file or dir

I'm trying to make a inotifywait script take different actions for files vs folders if it sees a close_write flag being raised in the watched directory, but cannot seem to get the checks working. In ...
1
vote
0answers
60 views

Create global enviromental variable after boot

I know about /etc/profile and /etc/environment, but I would like to set a global environmental variable after boot and login. By global, I mean an environment variable that can be accessed by any ...
4
votes
1answer
69 views

Redirect grep out to a file does not work [closed]

I am doing a recursive grep by the following command: grep -r "load" . > tmp.txt However, when I hit enter, the command does not execute and bash is waiting for more inputs.. My OS is Ubuntu ...
0
votes
1answer
62 views

where does history timestamp stored before i enable it

I tried to set timestamp for history. My first attempt was do export EXTENDED_HISTORY=ON command, and it seems like doesn't work. Then i do echo 'export HISTTIMEFORMAT="%d.%m.%y %T "' >> ...
1
vote
1answer
78 views

How to check for a folder inside a particular folder in shell script?

I am working on a shell script and python script as well. Python script is passing certain parameters to my shell script and then I am using those parameters in my shell script. Below is my shell ...
3
votes
1answer
123 views

Change script to use whiptail instead of zenity

I'm having difficulty converting some zenity based script to use whiptail instead. The working script looks something like this: #!/bin/bash xfreerdp /v:farm.company.com \ /d:company.com \ ...
1
vote
1answer
324 views

Not able to copy multiple files using rsync 3.0.9 version?

I am trying to copy two files using rsync from a machineB but somehow it always copies only one file but not the second file - Here is the syntax I am using - rsync -avz ...
2
votes
3answers
366 views

How to use rsync or scp to efficiently copy the files from machineB and machineC to machineA?

I am running my shell script on machineA which copies the files from machineB and machineC to machineA. If the file is not there in machineB, then it should be there in machineC for sure. So I will ...
2
votes
1answer
86 views

lockfile-progs utilities usage [duplicate]

There is another question that is related, but it is actually different, because I'm asking why the behavior of lockfile-create & lockfile-touch is different to the current contents of the manual ...
-4
votes
3answers
2k views

How to get IP Address using shell script? [duplicate]

Want to get the IP address using Shell script. Without knowing the eth0 or eth1 or eth2 How to get the particular IP address. I am not interest to get localhost address, want to get private IP ...
0
votes
0answers
27 views

What do the number in the file metadata mean [duplicate]

I typed ls -l in the terminal to get the file metadata of all files in the current folder What do the circled number : 1 & 2 represent in regard to the file metadata ???
0
votes
0answers
28 views

Boot Halts if Time if Reset

I have an old powerbook g4 with a dead battery & I am trying to run ubuntu 10.04 on it. Whenever the power cord gets unplugged the date gets set back to Dec. 31st 1969. Apparently when you ...
1
vote
1answer
295 views

syntax error in conditional expression while executing the shell script?

I am working on a project in which I need to make a url call to one of my server from the bash shell script.. http://hostname.domain.com:8080/beat After hitting the above url, I will be getting the ...
2
votes
1answer
44 views

Load application with module load and specify a different name from the default [closed]

I am using my local workstation to run applications stored on our local cluster. To load and run an application, I normally use: module load xxx However, there is a an application on my computer ...
1
vote
1answer
43 views

Who is setting http_proxy?

On an Ubuntu system with bash as the default shell for the interested user, the http_proxy environment variable is set to a specific value in a fresh GNOME Terminal. The .bashrc file for this user ...
0
votes
0answers
24 views

How to add color to my command prompt? [duplicate]

On my system: echo $PS1 prints: \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ I followed this tutorial here to modify it: PS1="\e[0;38m \u@\h: ...
8
votes
3answers
1k views

Why 'echo $0' gives different result for two different terminals?

I opened a terminal on Ubuntu using Ctrl+Alt+T and a different terminal by going to a directory and then right clicking and choosing "Open in Terminal". I did an echo $0 in both cases. In the ...
0
votes
1answer
45 views

Zenity refuses to work in background

I'm trying to create a background bash script which creates a popup in certain circumstances, however, my code only works when run manually in a terminal (e.g. not in the background). I've tried ...
0
votes
1answer
343 views

How to write conditional if statement in bash shell script?

I have a below shell script which will get the latest folder from my current directory in machineB and machineC. So I came up with the below command which will find me the latest folder inside - ...
2
votes
2answers
100 views

How to cd into a directory as part of shell script and do a word count of files?

I am trying to get the latest folder inside my directory in machineB and machineC. So I came up with the below command which will find me the latest folder inside - `/bat/data/snapshot` And that ...
2
votes
1answer
79 views

Using 'convert' with files that has space characters?

for f in $(ls mydir/*.jpg) do convert -thumbnail $size -quality $quality $f thumbsdir/$(basename $f) done I'm trying to code a script that takes a directory with images and generates thumbnails ...
4
votes
2answers
253 views

How do I execute a command on login for a system user with no home folder and no personal .bashrc file?

I set these users' home folders through the /etc/passwd file, but when they log in I would like them to activate a python virtualenv. If they had a personal .bashrc file, I'd just include the activate ...
2
votes
3answers
71 views

Is it a good idea to put environment variables to /usr/local/bin

I'm using aws cfn to start ubuntu instances, and I need to pass variables provided in cfn launch script to the scripts on the instance. For example, I may pass "db-server=db-2.domain.com" and there is ...
2
votes
2answers
159 views

How to use -d in ntfsundelete?

As far as I can tell from the manpage of ntfsundelete getting a file back is done with e.g. ntfsundelete /dev/sdb3 -u -m important.txt which would undelete the file in-place. If I don't want ...
2
votes
0answers
280 views

exit code of grep in trap where the script is launched by upstart service

recently I encountered a problem in ubuntu upstart and trap in bash shell. I use ubuntu 12.04 the upstart script(/etc/init/player.conf) is: start on (local-filesystems and runlevel [2345]) stop on ...
2
votes
1answer
476 views

Ubuntu 12.10 - setup a user, when ssh login gives me /etc/bash.bashrc: Permission denied

I setup a user on my Ubuntu 12.10 server named "deploy" and I believe i added the user to the sudoers properly. However, whenever I SSH into the server with this user, I get: -bash: ...
1
vote
1answer
479 views

Cron automated bash script to run run 1 bash script then another, plus integrity check

So I have a custom in-house app developed by a 3rd party. When the app is running, I can verify it is running with the "screen -ls" command. As long as screens are running for rails and freeswitch ...
4
votes
1answer
959 views

how to enable command history of shell

I am using ubuntu 13.04, in this the command history of the shell is getting erased on close. Can someone tell me how to prevent this from happening?
4
votes
1answer
200 views

Ubuntu unattended install : echo keypress to dialog

Ubuntu 12.04 LTS Server 64 My unattended-mode bootstrap.sh script contains: apt-get upgrade -y I know that during execution a primitive UI for GRUB installation will be shown which requires ...
3
votes
2answers
557 views

SSH tunnel through middleman server - how to connect in one step (using key pair)?

My question is basically how to turn my existing two steps into one step. I have a working SSH tunnel set up between two computers using a middleman server like this: ...
0
votes
3answers
150 views

Change terminal prompt Ubuntu

I have cloned a git repository to a folder in my workspace: /home/jose/workspace/very-very-very-long-repository-name/ so when i browse to it in my terminal it looks like ...
9
votes
2answers
850 views

Can I unfreeze bash or vim when SSH session freezes from timeout? [duplicate]

When my SSH session times out, the whole terminal freezes. Is there any way to break out of that connection? CTRL+C doesn't cut it.
0
votes
2answers
181 views

Linux 'mail' command: Can't open display

I've just installed the 'mail' command in Ubuntu (mailutils package) in order to view feedback from cron jobs. I type 'mail' at the prompt and see something like this: "/var/mail/*$USER*": 1 message ...
1
vote
0answers
85 views

variable name lost when tab completing to export an environment variable with a path

I'm trying to setup an environment variable using tab completion, e.g. snowch$ export JAVA_HOME=/usr/lib/jvm/java-6-oracle/ I used to be able to tab complete the folders after typing the export ...
6
votes
3answers
310 views

How does bash know how it is being invoked?

I've installed jailkit on Ubuntu 12.04 and I have set up a user's shell to /bin/bash - but when it is invoked it runs /etc/bash.bashrc instead of /etc/profile If you haven't used jailkit before ...
1
vote
0answers
69 views

Themed Tabs in Gnome Terminal

I've created a custom desktop session which upon login presents the user with a full screen gnome-terminal session. The idea is to have a TTY-like session but with the added advantages provided by X ...
3
votes
4answers
4k views

keyserver timed out when trying to add a GPG public key

I am trying to add a public key for installing a program with CPG. But i am pretty new to this but every command i found gave me the same error: gpg --keyserver keyserver.ubuntu.com --recv-keys ...
2
votes
2answers
250 views

Strange crontab-script interaction (bash)

I'm running Ubuntu 12.04 and bash. I've written a pair of shell scripts that allow me to set an alarm which, after ringing, unsets itself. The first, alarmset, allows me to enter a time and modifies ...
1
vote
1answer
822 views

explanation of the output's command “ifconfig ppp0”

I'm trying to understand the meaning the output of the command: ifconfig ppp0 Note that I'm using an internet-usb-board and so I'm sure that ppp0 interface is associated to it. In particular I have ...
6
votes
2answers
917 views

How to implement package install suggestion on Debian?

I have noticed that while on Ubuntu, if I type the following: mc and it isnt installed, I get the message below: The program 'mc' is currently not installed. You can install it by typing: sudo ...
2
votes
1answer
2k views

How to execute a shellscript when I plug-in a USB-device

I want to execute a script when I plug in a device in my Linux machine. For example, run xinput on mouse or a backupscript on a certain drive. I have seen a lot of articles on this, most recently ...
1
vote
1answer
367 views

bash autocomplete not working, does not 'complete'

I my bashrc. I have a bash completion for the command scp implemented as follows function _scp_complete { COMPREPLY="" COMPREPLY+=( $(cat ~/.ssh_complete ) ) COMPREPLY+=( $( find . ! -name . ...
3
votes
1answer
155 views

Issue when setting a default path in BASH

I have a BASH scripting question. I'd like the mention that I am new to BASH scripting; however, I am not new to programming. I am developing a simple BASH script to watch a given compass project. My ...
2
votes
3answers
1k views

How to start subsequent shells as root?

I run my local testing server inside a VM. I often have to open up multiple windows in it, and all have to be logged in root. Usually this is accomplished by writing su on every tab, a total of 7-8 ...
2
votes
2answers
107 views

Are any files loaded when a terminal session terminates?

I know that .profile / .bash_profile are loaded when a terminal session is started, either through local machine or SSH. Are there any files that are loaded/called when the session terminates? ...
3
votes
1answer
243 views

Display a right-click menu using a shell script

Is it possible to display a right-click menu using a shell script (or some kind of Unix command?) I'm trying to find a program that can be used to display a context menu at a specific location on the ...
1
vote
2answers
533 views

Lost ls directory highlighting after a crash

Normally commands such as ls and grep offer nice syntax highlighting for me. But my system crashed (running an ubuntu VM) and after I restarted, I no longer have this highlighting, it's all a dreary ...