Questions tagged [shell]
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 programming features such as variables, substitution, output redirection, and wildcards.
1,365
questions
1
vote
0
answers
153
views
mail send format issue in different linux servers
I have created a send mail script which will run on couple of my client servers. The mail was sent correctly in couple of servers but in some servers the format we receive is not what what we expected....
1
vote
0
answers
377
views
Linux: What could be the reason for random fails in updating passwd.byuid by running yppasswd?
In order to allow NOC users in my company to manage users through NIS I've created the following script:
#!/bin/bash
# This script will simplicate NIS user management.
# You will not be able to ...
1
vote
1
answer
2k
views
FreeBSD/FreeNAS: How to change group for multiple users?
I need to change group membership for a bunch of users.
How do I
list all users?
change multiple users to nogroup primary group?
add secondary/auxiliary groups to multiple users?
Basically I need ...
1
vote
1
answer
297
views
SFTP for users (own site folder)
I'm trying to config SFTP, so that my users can access their own site folder (with PSFTP/FileZilla). I use Vagrant, CentOS7, NGINX and .sh file.
This is my bootstrap.sh, for creating one of my users.
...
1
vote
2
answers
77
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 ...
1
vote
1
answer
156
views
How to generate a signature with a launchd plist? [closed]
Is it possible to implement the following shell script completely as a launchd plist to generate a signature with timestamp in the StandardErrorPath / StandardErrorPath files?
#!/bin/sh
echo "Hi, ...
1
vote
1
answer
285
views
cp/rsync command with destination as symlink to a directory
I am working on a cPanel backup solution at the moment. We are now informed about this exploit.
Exploit : Full ROOT ACCESS to server
1.) create malicious file from, normal user account:
mkdir root
...
1
vote
0
answers
593
views
Why Parent Class In a TC Rules Tree Not Working
The parent class in my TC rules script doesn't work as it garanteed! Can somebody tell me what is wrong with my script? Here are some details about my question:
From the chapter "9.5.4.4. Sample ...
1
vote
1
answer
1k
views
automatically start and and selectively stop multiple instances of couchdb on osx
I have successfully installed couchdb via homebrew:
% brew install couchdb
...and invoked mutiple instances as directed here:
% OLD=/usr/local
% NEW=/tmp/couchdb
% mkdir -p $NEW/etc/couchdb/
% ...
1
vote
2
answers
1k
views
dsh (dancer's shell): is it possible to specify ports in config file?
Using dsh you can define the list of machines in ~/.dsh/machines.list in the form:
<user>@<host>
I'd like to have multiple hosts with different ssh ports, like this (I tried):
<user&...
1
vote
1
answer
2k
views
Group permission inheritance and umask
Edit: in my case virtual_use_local_privs=TRUE did the trick.
i'm trying to force newly created files and directories inside foo/ directory to be owned by nginx user and to set the right permissions ...
1
vote
1
answer
490
views
The plugin of munin is always timed out
I want to use munin to make a graph of ttyACM0 in Linux, but munin can not create the graph. I found some information in "munin-node.log". it shows that "Service 'temperature' timed out". So I changed ...
1
vote
0
answers
103
views
runas or sudo equivalent on AS400 ibm iSeries (invoke it via java code) [duplicate]
Possible Duplicate:
“runas” or “sudo” equivalent on AS400 IBM iSeries
I am trying to invoke a program to run as another user(by getting input user/pwd) in AS400 OS using ...
1
vote
1
answer
168
views
Cygwin shell is overriding my Windows shell
I'm not sure what I did, but I've somehow got Cygwin installed in such a way that even when I try to run an ordinary windows shell, Cygwin is interfering. I have batch scripts that I want to run in ...
1
vote
1
answer
4k
views
Shell script to parse ip:port from a text file
I get daily a text file with ip:port, one per line, example:
11.22.33.44:80
22.33.44.55:8080
33.44.55.66:7777
I would like to parse the first ip and port in two different variables, then write them ...
1
vote
0
answers
854
views
Automate an interactive command which use /dev/tty
well pretty much it's in the title.
I've a interactive command. This one ask for a password through /dev/tty. I use this command within a shell script. So the command should read the information ...
1
vote
3
answers
3k
views
Howto check open ports of a specific tomcat java instance
For the moment I've managed to do it with:
root@server:~# for i in $(netstat -lp | grep java | awk '{print $7}' | awk -F '/' '{print $1}' | sort | uniq); do ap=$(ps p $i | grep -v PID | grep activemq ...
1
vote
0
answers
13k
views
Windows GPO "Allow Remote Shell Access", where to set 'False' once you enable it?
OS : Windows 7 64 bit
Under Local Group Policy Editor > Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > Windows Remote Shell >
there is a policy ...
1
vote
2
answers
458
views
init.d service died
Adapting some code from a linux forum, I've added a service script to /etc/init.d on my ubuntu natty server to start/stop/restart node.js
It literally was working the first day I made it, but then ...
1
vote
1
answer
211
views
how to limit maxlogin for a port forward over ssh user who Do not execute a remote command
I have some users, who connect to my server through the ssh for port forwarding and ssh tunneling, but there is a problem:
I cannot limit their concurrent logins, because they have no session and ...
1
vote
1
answer
88
views
Something to print some monitoring stuff in a shell screen
I think I saw it before somewhere, but I can't remember where and what it's name was...
Well, basically I'm seaching for a soft that can put some monitoring values at the top (or th bottom) of the ...
1
vote
2
answers
153
views
Tar only logfiles for all sites on server
I need to transfer all of the log files off of a server and hope someone can help me. I'm pretty stuck.
The directory and file structure is like so.
/var/www/vhosts/site1.com/statistics/logs/...
1
vote
3
answers
582
views
GUI SFTP client that will copy files and folders locally instead of downloading/uploading
I'm looking for a GUI client (preferably Windows) that will recognize when you copy files remotely, and will default to running a local shell command (f.a :
sfpt> !rsync -a /files/ /copyoffiles/
...
1
vote
2
answers
316
views
ModSecurity Error Entries
Recently, I was passed some error logs to take a look into, since we'd had some network spikes recently. However, I've never worked with modsecurity (I'm a programmer just doing this since we don't ...
1
vote
3
answers
438
views
How to run a shell script on a server farm periodically
I have a requirement to collect custom metrics (a shell script) from a logical server cluster every five minutes. This server cluster consists of 10 virtual machines. Once option i am familiar with is ...
1
vote
3
answers
3k
views
"svn update" on a remote machine
I need an ability to run "svn update" on a remote machine for a non-technical user, how would I go about it?
Our non-techincal users are using Windows XP and have Tortoise SVN client installed.
I'm ...
0
votes
5
answers
2k
views
Which characters if cat'd will mess up my terminal and make a ton of noise?
I've written a wrapper script that I alias to cat, called safecat, that protects me from accidentally cating binaries and getting a ton of screeching from my PC speaker. Right now it considers a file ...
0
votes
2
answers
28k
views
Shell Script to connect to Database and execute query [closed]
#!bin/bash
Query="update table_name set colume ='i' where column_name is NOT NUll"
mysql -u username -p password mysql <<EOF
$query;
EOF
The above script is not working
0
votes
2
answers
7k
views
Run a part of script shell in nohup
How can run a part of a shell script in nohup mode ? My script goes like this:
#!/bin/bash
command_1
script2.sh
script3.sh
...
(tests & loops, etc)
script4.sh
script5.sh
and what I would like ...
0
votes
2
answers
692
views
One-App SSH Logins using login shell?
I want to run an application on a Linux machine which will be accessed by most users using PuTTY. I want to start that app and, when it's done, I want it to end the SSH session. Is it secure/...
0
votes
3
answers
379
views
Shell Scripting - How To Replace Lines
Ubuntu 9.10
Hi Guys,
I want to create a script that will automatically update a single line in an .htaccess file. Could someone please point me to some instructions for creating a basic "find and ...
0
votes
4
answers
3k
views
Shell script auto prompting yes to everything
How to I run a command in a shell script auto prompting yes to prompt to the use, so I can automate a script?
0
votes
2
answers
178
views
redirect command executed along with output shell
I would like to redirect the command executed along with the output to a file.
for example:
#ls >ls_out.txt
ls_out.txt should be something like :
ls
file1 fil2
Thanks!
0
votes
1
answer
226
views
How can I append IPs (a whole class C range) to a file using shell scripting? [closed]
How can I use shell scripting to append a range of IPs to a file?
0
votes
2
answers
2k
views
Parse java console output with awk
I'm trying to use awk to parse an output generated by a java application, but it isn't working. It seems that the command after the pipe isn't able to get/see the data throwed by the java app.
I'm ...
0
votes
3
answers
5k
views
How can I recursively change the case of files and folders under bash
I have some files and folders that are all in uppercase that I want to rename to their lowercase equivalent. What would be the best way to go about doing this in bash on a Linux system?
As an example ...
0
votes
2
answers
251
views
How can I use symbolic signals in an at job?
In this answer on SO, I gave an example that should have used a -SIGCONT signal in a job submitted to at. However, I found that the process that I had stopped with -SIGSTOP did not continue. When I ...
0
votes
2
answers
2k
views
shell script for running ssh-agent
Good day,
I have read through the similar topics all day long but unfortunately could not find the answer suitable to my situation. So here is what I'm trying to do. I have the shell script with quite ...
0
votes
2
answers
127
views
Linux Basic Shell for all users [duplicate]
Possible Duplicate:
How to restrict the users' shell allowing to execute shell programs
I used to access this Ubuntu 8.04 server that had a very limited Shell. For instance you couldn't key ...
0
votes
5
answers
2k
views
Hiding other users' processes on top
I'm running a Debian server and giving out shell access for a handful of friends. I'd like to hide the running processes from those normal users, so that for example top only shows their own processes,...
0
votes
3
answers
754
views
Queue based shell in linux?
I would like to control users programs execution based on server load.
Each user uses bash. Are there way to make a some kind of queue where execution for the commands from command line will be pended ...
0
votes
5
answers
1k
views
How to get coloured file listing in windows cmd shell?
A few older ones in here will probably remember a cute little proggie from DOS days, hdir it was called. Did nothing special, except show the file and directory listing in colour.
(there were others ...
0
votes
1
answer
432
views
Use shell if defined in LDAP, otherwise default
How should /etc/sssd/sssd.conf file be configured to use the shell defined in LDAP and the default one if the variable is not defined in LDAP?
0
votes
2
answers
1k
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
2
answers
1k
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
2
answers
5k
views
How to add a variable into a grep command
I'm running the following grep command
var=`grep -n "keyword" /var/www/test/testfile.txt`
This work just as expected but I need to insert the file name dynamically from a loop like so:
var=`grep -n ...
0
votes
3
answers
100
views
Shared Hosting Shell limitation? [closed]
I have a small project for a client and there are some requirement that initially pointed me toward using a VPS.
However, after reading a bit more online, I saw I could work out with shared hosting ...
0
votes
2
answers
3k
views
Linux Shell Grep with output to text file
I am trying to search through a number of sites on my server for a few key words and output these to a text file. I only know how to do:
grep -r "keyword1" *
grep -r "keyword2" *
I need to be able ...
0
votes
2
answers
412
views
Shell bad interpreter problem
I moved my system from ubuntu 9 to debian 5 and the cron each time that try to execute a script throws...
-bash: ./somescript.sh: /bin/sh^M: bad interpreter: No such file or directory
all my scripts ...
0
votes
2
answers
291
views
Change linux shell
On my Centos7 Server I have different shells for my users.
For example the terminal as root looks like:
[root@hostname www]#.
The terminal as a different user looks like bash-4.2$.
If I type echo $0 ...