1
vote
1answer
60 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
32 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
58 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
160 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
34 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
144 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
15 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
97 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
33 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
33 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
21 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
250 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
63 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
71 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
215 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 ...
1
vote
1answer
222 views

Script to delete text files

I was trying to make a script that searches for all ASCII text files in the directory that you give and after that writes path of every file to a text file. After that it suppose to show head of each ...
2
votes
3answers
63 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
103 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
219 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
340 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
263 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
473 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
171 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
440 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
100 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
474 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
168 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
78 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
234 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
61 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 ...
2
votes
2answers
2k 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
200 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
662 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 ...
4
votes
2answers
656 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
1k 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
297 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
144 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
803 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
103 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
223 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
437 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 ...
3
votes
0answers
112 views

tab-expansion and “./” bash shell [closed]

Maybe someone here would be able to help me out. Have installed Ubuntu 12.04 LTS (kubuntu) on two machines. The .bashrc and .bash_profile files are identical as the file structures on each machine is ...
3
votes
2answers
388 views

How to enable local ~ autocompletion for scp?

Too late: The machine, OS and configuration in question is no longer in use, so I can't verify any more suggestions. I have not encountered this problem in Fedora or Arch Linux. If you are having this ...
9
votes
3answers
12k views

Shell script fails: Syntax error: “(” unexpected

I've been working on a script that automates setting up a development environment for Raspberry Pi development (step by step details that work are here). The script is linked in that article but ...
2
votes
2answers
3k views

Minecraft server daily restart script

I've been searching to try to find the information I need, but I have so far been unsuccessful. What I would like to have happen daily is the following: Every time the machine starts, the Minecraft ...
3
votes
3answers
6k views

Automating textual input from a bash script without using EOF

I'm running Ubuntu Linux. Suppose there is a program called myprogram. This program prompts the user for input; specifically, the user must type an integer when prompted and press Enter. I would ...
1
vote
2answers
3k views

SSH + Sudo + Expect in Bash script: Run command with sudo in remote machine

I am trying to automate the deploy of some .deb packages with an script. I want to execute sudo dpkg -i $myDeb.deb in a list of remote machines I can access with ssh. I've tried to automate the ...