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

-3
votes
1answer
14 views

How to cut a string after a number of characters in unix? [on hold]

How to delete all characters in one line after point with with sed? I have a file with multiple lines like this: 123456789 3483 98765432 56345 985745634 3469 67495735 87654 Now I want to delete ...
0
votes
1answer
32 views

httpd reload as second command in bash fails

I am trying to run a command that carries out one action, to renew a certificate, and then reloads Apache. To do this I am running the following: sudo /home/ec2-user/letsencrypt/letsencrypt-auto ...
3
votes
2answers
30 views

Compare string on shell script

I'm creating a script to check the requirements about VM in one of my customer. The first part of the script is check if the OS is virtual or not. To achieve this goal I create the following script. ...
1
vote
1answer
21 views

Restrict user from executing shell commands using PHP

Let's say that i have shared hosting and i want to secure that place, from executing shell commands. I'v installed suphp, so that users can execute PHP separately. I also did some other things in ...
-1
votes
1answer
23 views

bash scripts work fine when I run it from command line but not from cron [duplicate]

I have this bash script in runtests.sh file #!/bin/bash cd /Library/WebServer/Documents/protractor_clipboards protractor testscript.js When I do this on terminal ./runtests.sh But when I try to ...
-3
votes
1answer
25 views

Run Windows Explorer on remote system from its cygwin shell through SSH [closed]

Please consider my problem :) 1) I Have a Windows 7 - x64 system with cygwin installed and SSHD running. 2) From another Windows machine , from futty, SSH to the above machine. 3) Command "TaskKill ...
0
votes
0answers
27 views

linefeed in bash script - to email [migrated]

I am doing printf to a logfile and having that logfile send through mailx, however, it seems that the linefeed "\n" are not recognised or captured in the mail. Snippet of script as below (notice the ...
-1
votes
1answer
46 views

How to use the awk,sed Modify the text?

As follows, some text 16G 16G 1.9G 40G 4G 4G 952M 60G 16G 16G 1.6G 40G 5G 780M 5G 80G I want to change all the unit from 'M' to 'G', like this 16G 16G ...
0
votes
0answers
4 views

App started as a service gets very low memory limit

I have created a service to manage an application, the Slurm resource manager. I however keep having problems with the resource availability. This is the service configuration file [Unit] ...
0
votes
1answer
74 views

Linux(redhat);Crontab; bash - script working from shell but not in Crontab - assigning command to variable fails

I know that my question was asked several times, but there is no solution for my problem. In my Company there is an Application running on a RedHat Mashine. Users connect a text Based GUI via ssh to ...
7
votes
0answers
1k views

What's wrong with this for loop in bash script? [migrated]

I am trying to print a simple value for $AR1_p1 but the variable $i is not evaluating. for i in 1 2 3 4 do AR1_p1=22 AR1_p2=23 AR1_p3=24 AR1_p3=25 echo $AR1_p$i done It's like concatenating ...
-1
votes
1answer
30 views

Folder migration ideas

I've got to the point where it impossible to load a folder on the server because there are so many sub-folders within it, getting close to 100,000. I currently store user's images in a filing system ...
0
votes
1answer
11 views

Different shell for SSH login on specific machines

I have Active Directory users with no local accounts, so they cannot use chsh. They can login to multiple different types of server and most of the time /bin/bash is the correct shell, or at least for ...
-1
votes
2answers
51 views

shell script to open many terminals from a parent terminal and execute different cmds

I want to open 5 terminals from a parent terminal and place these terminals on the screen properly so that each terminal can be viewed properly at the same time. Also, i want to execute differnet ...
0
votes
0answers
13 views

(Git-) Process not ending properly [duplicate]

I use a cronjob to call a git pull every minute: MAILTO="" */1 * * * * /home/pull.sh script: cd /home/webdir git pull origin release | grep -v "Already up-to-date" >>/home/git.txt This ...
0
votes
0answers
28 views

Not able to find root disk using prtconf in solaris

I am working on Solaris 5.10 server. I have a shell script for backup purpose. It uses the prtconf command & then searches for the root disk to create the backup. It runs the below commands. ...
2
votes
1answer
18 views

How properly handle deletion of pid.file in service script

I'm trying to write service script for application. So I can control it like this: ./myscript.sh start|stop|status On startup pid.file with process id creates, and based on it I can check status ...
0
votes
1answer
18 views

give www-data the permission to write into /home and others root directories

I have a big problem since few days with permissions on my Symfony2 application. The background : I write a PHP app with symfony2 which gives an overview of many Moodle instances on each servers ...
0
votes
2answers
56 views

How to ensure that the script and its command get killed once terminal is closed

I have written a script and it is working fine . It do some tail and grep operations. When I am closing my terminal and the greping the PID of my script , I can find the script is still present in ...
0
votes
1answer
53 views

How to edit /proc/partitions file in linux

I know /proc is a VFS and cannot be updated by user from shell prompt. this is my understanding from the beginning. Now , I am writing one code and where I am taking care of corrupted /proc/partitions ...
0
votes
1answer
14 views

List files that will be overwritten by tar extraction

Say I have a tarball ~/foo.tar containing foo/ foo/bar.txt foo/baz.txt foo/qux/ foo/qux/corge.txt foo/qux/grauply.txt And in my home directory ~ I have an existing foo directory and the existing ...
-1
votes
1answer
54 views

Using rsync with StrictHostKeyChecking and find files older than 5 minutes from remote

I would like to use rsync to sync my files from remote to a local directory. Therefor I use StrictHostKeyChecking so that there's no need to enter a password. Now I would like to only sync files ...
0
votes
2answers
58 views

How do I change my default shell on a domain account

I use a samba4 domain account to log in on my laptop. I wanted to try zsh out, but since my user doesn't reside in /etc/passwd I found that chsh can't find my user. Can anyone advise how I can change ...
1
vote
1answer
27 views

How to pipe a file being written to?

I have a binary file that is being written to continuously. I need to read the full content of that file to a pipe (either to nc or to a FIFO) and keep reading it while its is written (i.e. the ...
3
votes
1answer
140 views

bash if statment unexpected behavior in crontab job

Here is the script bash --version | head -n1 if [ "$1" == "now" ] then echo if now execut job else echo else "_"$1"_" # make sure we are not picking any spaces if [ condition ] ...
0
votes
1answer
120 views

PHP script error 'exec(): Unable to fork…' on Ubuntu 14.04.3 LTS

I'm running unittest scripts and for test case setup I need to run shell command from time to time. As a result shell command is run around 50 times during unittest execution. It works ok on CentOS ...
1
vote
0answers
35 views

Monitor disk occupancy

The problem should be simple, but not so obvious to me. I have a process that creates temporaries in a specified directory, under MacOS X. I need to find the disk occupancy of the process, if ...
2
votes
1answer
64 views

I need a command to create a unique fingerprint from unix machine

I need to create a serial number for my application in a Unix machine. The generated serial number should be unique Do not change over time (Only changes after hard drive or mother board changes) Do ...
2
votes
1answer
98 views

lxc-attach command with redirection

I'm setting up for a Proxmox 4 server a script that migrates OpenVZ dumps from a Proxmox 3.4. The scripts scp the backups, restores them and so on. At a time of the process, I'd like to wipe ...
1
vote
2answers
27 views

Echo Variable - Same way, different output

I wrote a shell script with the following content: #!/bin/bash value=`cat test.txt` echo "Output: $value" >> currentOutput.txt By executing this script in shell, it writes correctly the ...
0
votes
0answers
18 views

SSH client - prompt editable as Windows control

Is there a way to configure PuTTY (or some other SSH client) to be aware of what's currently typed into the prompt and make it editable via the mouse (like in an input box / textfield that shows at ...
0
votes
1answer
64 views

Prevent accidental execution of commands in Linux if pasting text containing one or more return characters

Sometimes if text that is on the clipboard is pasted into shell and it contains a return character it will execute even though that wasn't the intention. Sometimes even multiple lines may be pasted ...
1
vote
1answer
63 views

Bash: How do I pass “command not found” text into my trap function?

I have the following: test.sh . Foo.sh Foo.bar Foo.baz Foo.blah and Foo.sh function Foo.bar() { echo 'I am a bar!' } function Foo.baz() { echo 'But, I am a baz!' } function ...
1
vote
0answers
25 views

restart apache instances using cgi shell script [closed]

I'm trying to restart my apache instances in the server from my browser. For this I'm using shell script with cgi. Below is my code snippet. echo '<FORM METHOD="GET" ACTION="">' ...
0
votes
2answers
113 views

Changed /bin/sh to /bin/busybox for root, broke SSH access. How to fix it?

I made a silly mistake... I was playing around with busybox and used chsh to switch the root shell from /bin/sh to /bin/busybox which seems to have broken the SSH access. When I do: root@dev:~$ ssh ...
1
vote
1answer
19 views

SFTP script gets different destination response when run from different directories

I'm baffled by an SFTP shell script and any help would be greatly appreciated. I wrote an sftp script to connect to and upload ACH information to a banking site. The script uses 'expect' to wait for ...
0
votes
0answers
35 views

why a user account with /bin/false shell in directory server is asking for membership in groups?

Firstly, we use ldap for user authentication. I have accidentally deleted a person account(his loginShell is /bin/false)from our directory server(sun DS7) running on red hat enterprise linux, although ...
0
votes
0answers
193 views

Restart ffmpeg process streaming rtmp video if it fails using shell script

We use ffmpeg to forward streams live. Often due to unknown reasons or due to the stream stopping temporarily the command stops running in the background. What's the best way to monitor and continue ...
1
vote
1answer
40 views

Running “find” and piping the output to “wc”/“sort”, inside an outer “find -exec”

I've a folder used by imapsync to store its own cache. Such a folder contains a subfolder for each of the mailbox I'm syncing, and nothing more: [dv@monitor] find * -maxdepth 0 -type d | wc -l 126 ...
0
votes
0answers
22 views

Why upstart starts my processes in an inconsistent way

I'm debugging a strange issue with upstart managed jobs. I have a ruby web application which is started using passenger and I generate upstart configuration files using foreman The problematic ...
29
votes
5answers
4k views

Why does it take tens of seconds to get a shell prompt?

It's a sort of regular occurrence that, after SSHing to a server (or even opening a terminal on my Mac), the login banner prints immediately but it takes ~10 seconds to a minute for the shell prompt ...
1
vote
2answers
99 views

Shutting down host from within jail

I've created a jail with ssh using Finch-Freebsd on a NAS4FREE and added a local non super user to access the jail via ssh. I want to be able to grant this user limited shell access specifically to ...
0
votes
1answer
27 views

Cannot change default shell in solaris 8

I have a situation. We have Solaris 8 machines. For every users we have to change the shell from /bin/sh to .../sdshell. So far we have been doing it by editing the /etc/passwd file manually. Is ...
1
vote
1answer
41 views

Python script crashes when run via Cron

I have a python script that completes exactly as expected when run manually as the root user. When I put the script into cron.daily it crashes 100% of the time. The error is a timeout error, but ...
0
votes
1answer
62 views

sudo (-E) doesn't preserve path, even when configured appropriately

I have circus installed in a python virtualenv using virtualenvwrapper, and I want to run it with sudo. Sounds simple, right? Unfortunately even after reading man sudo and man sudoers, I don't ...
1
vote
2answers
51 views

How to prevent rsync from chown'ing remote users files

I'm doing rsync /local/path/to/src user1@remote:/path/to/dest. dest belongs to user2@remote. How do I keep rsync from chown'ing dest to user1 after syncing? Please note that I have already tried ...
0
votes
2answers
26 views

Move all ls output and symlink

I want to move some of my files in directory to another drive and create symlink for each of them in the old directory that will point to the new directory. For example, [root@localhost olddir]# ls ...
0
votes
2answers
112 views

How can I redirect logfile output to a network socket?

I am using a commercial Java app which writes it's logfiles using log4j. I'd like to get those logfile entries into Syslog where we have specific filters setup to trigger on system events. Log4j ...
0
votes
0answers
26 views

bash scripting and comparing 2 directories - Beginner [duplicate]

My problem is that i have to check what files are included in the $directory, then i have to make a new file with name specified by me and compare if the name doesn't already exist in this directory ( ...
0
votes
0answers
10 views

shell script for checking the list of websites status [duplicate]

How can i write a shell script for Checking the list of websites in a server which are running up or not. If they are running leave it. Those who are not running what type of error it is popping out ...