A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion. Not only does it allows the user to run programs from a text interface, but frequently offers basic ...

learn more… | top users | synonyms

2
votes
3answers
75 views

Common login script

Few weeks ago I thought it would be a good idea to write a script which should send me an email whenever some user would log in into my server. So I came to a perfectly working script ...
0
votes
1answer
30 views

Shell script won't run ruby script file

My shell script (my_shell.sh) won't run the ruby script ("ruby_script_1.rb) in it. my_shell.sh #!/bin/sh # Invoke the ruby script here ./ruby_script_1.rb It could not find where the ...
0
votes
1answer
27 views

Bash function hangs while command run perfectly without function

Following function hangs : ssh() { local RESULTS; RESULTS=$(ssh $USERNAME@$SERVER $SSH_COMMAND1); echo $RESULTS; } ssh; while if i run following commands they work fine : ...
0
votes
2answers
47 views

Access local console via SSH

I am searching for a way to interact with a local console via SSH - just as you would do with an directly connected keyboard. In my particular case I got a debian server (console only, no X system) ...
0
votes
0answers
9 views

Ctrl-C is ignored by pppd when put in a shell script

I'm trying to connect to GPRS network through a serial port connected GSM modem. When I call /usr/sbin/pppd call <peer_name> from the command line, It correctly receives and handles Ctrl+C from ...
0
votes
0answers
19 views

prevent normal users from directly running their own binary file in pbs system

In our cluster with PBS batch system (torque) installed, we wish all the users execute their jobs by qsub so that the CPU resources can be well managed. However, it is found that users in our cluster ...
0
votes
0answers
13 views

bash globbing - strange behaviour [migrated]

I was playing with bash globbing recently and I noticed the following: First, make 2 dirs: $ mkdir test $ mkdir test2 Then: $ echo test? Outputs (correctly): test2 But: $ ls test? Outputs ...
1
vote
3answers
49 views

How to log multiline message with logger command?

I want to log a multiline message into the system logger via the commabnd echo -e "foo\nbar" | logger But it appear as 2 logs. Is it possible to log as a single log?
3
votes
5answers
174 views

Hide the output of a shell command only on success?

Hiding the output of a shell command usually involves redirecting stderr and stdout. Is there any builtin facility or command which by default hides the output but on error dumps all the accumulated ...
2
votes
2answers
50 views

How to keep script from swallowing all of stdin?

I have a script that reads from a pipe in a loop and runs an expect script and a normal shell script in the loop. Both scripts run ssh to another server to grab a piece of data. For example: cat ...
0
votes
2answers
45 views

Delete oldest directory, skipping two of them

I have to delete oldest directory. But, two of directories does not have to be "included" in this action. So, directory content looks like this: [root@myserver backup]# ls -la total 84 drwxr-xr-x 21 ...
2
votes
2answers
67 views

Linux locale: en_US.UTF-8 vs en_US

I usually config my ubuntu via sudo locale-gen --purge en_US.UTF-8 And I've the installed locales # locale -a C C.UTF-8 en_US.utf8 POSIX Is it okay since I am missing en_US?
8
votes
6answers
326 views

Find directories, where files with a specific ending are missing

I want to display all directories, that do not contain files with a specific file ending. Therefore I tried using the following code: find . -type d \! -exec test -e '{}/*.ENDING' \; -print In this ...
1
vote
3answers
55 views

locale-gen with purge does not work

I use the --purge option to remove existing locales before generating new one, but seems cannot remove existing locales? e.g. # locale-gen --purge en_US # locale -a C en_AG en_AU.utf8 en_BW.utf8 ...
1
vote
5answers
126 views

How to split the output into different files?

I have a input file like foo xxx yyy zzz foo xxx yyy zzz foo xxx yyy zzz foo xxx yyy zzz bar xxx yyy zzz bar xxx yyy zzz foo xxx yyy zzz .. How to split the input file by line, into foo.txt ...
0
votes
1answer
60 views

Shell script only executes partially when run with CRON [duplicate]

I've written a shell script that does the following: Retrieve mail from a POP3 account (using GetMail) Save a copy of that email to S3 (using AWS CLI) Email me the filesize of the email The ...
1
vote
1answer
53 views

Replacing LineFeed \x0a with SED

I have to delete lots of Linefeeds (Hex \x0a) in a logfile. I just have sed to solve the problem. It is a bit complicated I know.. Do you have idea how to solve the problem? Here is an example ...
0
votes
1answer
291 views

What's the difference between sudo su - postgres and sudo -u postgres?

PostgreSQL users peer authentication on unix sockets by default, where the unix user must be the same as the PostgreSQL user. So people frequently use su or sudo to become the postgres superuser. I ...
3
votes
2answers
90 views

What is the difference between “su --command” and “su --session-command”?

Running # su - oliver --command bash gives a shell but also prints the warning bash: no job control in this shell, and indeed Ctrl+Z and fg/bg don't work in that shell. Running # su - oliver ...
0
votes
1answer
94 views

Disable the ability to hide bash command history

User can hide the command history in bash by either append a space before the command unset HISTFILE How to disable this?
0
votes
1answer
83 views

Create setenv.sh to set system property

I have to use setenv.sh to set system properties. I am using Linux OS and Tomcat Server 6. As described here Linux Environment- setenv.sh , I have created a setenv.sh in tomcat/bin, and the only ...
0
votes
1answer
22 views

Dpkg: After comparing config files, how do I revert back to make my choice?

I'm part way through a fairly large apt-get upgrade which had 65 packages to be updated. I've gotten to a config file "merge conflict" where both my local config (containing a licence key) and the ...
0
votes
2answers
63 views

Gnu parallel not utilizing all the CPU

I have a simple python script that read from stdin (a single line), do some processing (string parsing, no IO involved) and output to stdout e.g. python parse.py < in.txt > out.txt I have an ...
0
votes
1answer
81 views

How to set the default shell when chsh is not present

I've a Synology DS412+ NAS box running Busybox, which has a default shell of ash. Previously, ipkg install optware-devel was run and it installed bash and set it as the default shell. Running ipkg ...
8
votes
2answers
426 views

Symbolic link and sudo

I create a symbolic link: ln -s /tmp/folder1 /tmp/folder2 Then I go to /tmp/folder2 and run pwd: $ cd /tmp/folder2/ $ pwd /tmp/folder2 $ sudo pwd /tmp/folder1 # <-- This is the odd part Why ...
-1
votes
2answers
47 views

can't find the executable for the command linux 'source' [closed]

i am using ubuntu server 12.04 lts. I am looking for the executable of the linux command source i can not find in the /bin nor /usr/bin nor /usr/sbin nor /usr/local/bin . I used whereis source it ...
4
votes
1answer
60 views

Is there a streamlined way to export settings from an existing CentOS 5.10 server for local Vagrant provisioning? (Puppet, Chef, shell, or otherwise)

I've recently started the process of learning how to use Vagrant for spinning up a local development environment. (after getting frustrated with the various WAMP stack options) Vagrant is great so ...
0
votes
0answers
471 views

rsync: getcwd(): No such file or directory (2)

I want to sync Server1 and Server2's logs to LogServer. For Server1: rsync -avz -e 'ssh -p 2188' user@server1:/usr/local/servers/logs/* /usr/local/logs/ This one works, but for Server2: rsync ...
0
votes
1answer
48 views

How can the mutt shell-escape feature be disabled?

We are thinking of offering mutt for our member's email client. The user's shell is instead the mutt application launched on their Maildir folder. It works great so far but one huge problem is the ...
2
votes
1answer
33 views

Inspecting how $PATH gets created

Is it possible to "listen" to a variable's value during the start of a new shell? I have a script that checks for the $PATH variable in the typical places, but I'd like to try something different. ...
2
votes
3answers
68 views

How do i change the global login shell on a unix system?

I want to set the login shell (the shell they get when they log in) of all existing and future users. The correct way to change the login shell seems to be chsh. But this only allows me to change the ...
0
votes
1answer
206 views

Automatically starting C# Mono application on Ubuntu server

I have a TCP server written in C# which I will run on my server. I've tested the application running on the server and client side and it all works great! I'm using mono on my Linux server to run the ...
2
votes
2answers
38 views

ssh dissable login, but allow copy-id

I have a user that's only used for a proxy, so no one can login. #passwd file entry proxyuser:x:996:99::/home/proxyuser:/bin/false but, I'd like to enable ssh-copy-id to that user How do I do ...
0
votes
4answers
169 views

cron job executing script [duplicate]

I have created a script that works as expected in shell but cron job does not seem to run it. when I check my cron mail, I see that it prints "hltv is not running" but does not create a screen ...
0
votes
3answers
125 views

Changing the mysql bind-address within a script

What would be the best way to change the mysql bind-address in the my.cnf from a shell script? Is there a way using a tool like mysqladmin or should I use sed or should I simply append it to the ...
0
votes
2answers
36 views

Creating an environment variable for a specific user

When you set an environment variable in linux is it set only for the user who executes it, or can you specify a user when you store it, or instead is it always available for all users?
1
vote
2answers
53 views

Samba server: Who used all of our storage yesterday?

First day there is plenty of free storage space, next day someone used up all free space. Is there an efficient way to find out which directory has an increased storage use? I know how to find new ...
12
votes
4answers
530 views

How do I start a second shell when in single user mode?

This may sound like a contradiction in terms, but I've recently needed to use single user mode (aka maintenance mode) for some time (days!) while trying rebuild a broken RAID array. While doing this, ...
0
votes
1answer
52 views

Starting supervisor with init fails

I installed supervisor using pip on my debian 7 installation. I then grabbed this file and moved it here: /etc/init.d/supervisord https://github.com/Supervisor/initscripts/blob/master/debian-norrgard ...
2
votes
1answer
147 views

Bash: two commands in dollar-parenthesis don't have same behavior

I don't undertsand why, in Bash: echo $(hostname --fqdn) works, echo $(id -un) doesn't (id: –un: No such user). Backticks give the same results. Is there some good practice for using this ...
1
vote
3answers
147 views

how to make alias with quotes

I tried to make alias with quotes as following: alias myalias='ps -ef | grep tomcat | kill -9 `awk {'print $2'}`' but as you can see i already have ' in awk so i tried to replace awk {'print $2'} ...
0
votes
1answer
28 views

Connecting to server with remotely generated SSH key

I run a process on my server where I generate a public and private key. The public key I use for github. I was wondering, if I do a readout of the private key of the remote system, can I then save ...
-1
votes
3answers
163 views

What is default shell for users in /etc/passwd for Solaris 11?

For a Solaris 11 Server Config Review that I am doing, I have following lines in my /etc/passwd file: root:x:0:0:Super-User:/root:/usr/bin/bash daemon:x:1:1::/: bin:x:2:2::/usr/bin: sys:x:3:3::/: ...
0
votes
1answer
38 views

Trouble with $PATH on debian

I think I have a problem with $PATH. I am running a shell script and it is complaining that it doesnt recognize the command even though when I run it manually it does. Shell Script: #!/bin/bash # ...
-5
votes
1answer
40 views

How to update SASS for the whole of a VPS automatically? [closed]

I have a VPS with SASS, and I have configured it correctly. I have multiple users on my server, and they don't have SSL access to the server. Some of them use SASS, and I don't want to have to ...
1
vote
2answers
174 views

permission denied in running script

I am running a script but there is an unusual warning: This is what happened in my console #whoami root #ls -l test.sh -rwxr-xr-x. 1 root root 1894 Feb 2 01:58 test.sh* #./test.sh -bash: ./test.sh: ...
1
vote
0answers
66 views

EC2 - editing .bashrc causes terminal to hang and checks to fail

I've been testing this for the past few hours with no luck. When launching an Ubuntu 12.04 EC2 micro instance, I SSH to it, create a new user and continue with installing Ruby version manger under ...
0
votes
2answers
201 views

running a remote shell script that switches to a user does not return to the issuing local server shell

When I run a script such as this: ssh -t root@10.10.10.10 '/tmp/somescript.sh' where the script is defined as: #!/bin/sh mkdir -p /data/workday/cred chown -R myuser:myuser /data su myuser - # ...
1
vote
2answers
291 views

How to view and kill PHP processes?

I'm very new to using SSH and am having trouble finding a way to view and kill PHP processes that are running. When I say "PHP processes," I mean PHP files that were started through the browser, but ...
2
votes
2answers
58 views

Will locally mounting root filesystems of all remote servers being managed eliminate need to share dotfiles?

I've got about 10 remote servers being managed, through SSH, and I typically just SSH into each of them for remote management tasks. This requires me to have duplicated many of my dotfiles (like ...