Tagged Questions
0
votes
0answers
15 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
1answer
149 views
Linux- Permission denied?
I'm installing Neo4j server as a linux service, but when I install it, I get the following message:
/sbin/insserv: Permission denied
What is this? What should I do? I'm running everything with ...
-1
votes
1answer
64 views
Automate git-pull, stuck with keychain
I'd like to create a cronjob to automatically run a git-pull every minute.
The problem is that my repo is private, I had to create keys on my system (Ubuntu Server 12.04). I installed keychain and ...
0
votes
1answer
52 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):
...
1
vote
4answers
52 views
Howto: command/tool ability check
When developing a shell script that should run on various unix/linux derivates, i sometimes have the problem that some tools have to be called in a different way compared to other systems. For example ...
4
votes
3answers
132 views
How to execute a command on multiple hosts using IPv6 only?
First of all there is pdsh which is essentially a parallel distributed shell which may execute commands on a list of given hosts. However, I find myself in an IPv6 only problem setting. It seems that ...
0
votes
0answers
76 views
getting integer value more than 10 digit in single varaible [closed]
if i give more than 10 digits in single integer variable means
I will get answer as 2147483647
I tried to more than one system
all systems are showing this result only
example:
main() {
int ...
2
votes
2answers
644 views
While loop read multiple lines from a grep
I'm writing a script in AIX 5.3 that will loop through the output of a df and check each volume against another config file. If the volume appears in the config file, it will set a flag which is ...
0
votes
1answer
77 views
Execute command in background and get notified when done, with time of execution
How do I make sure I get notified when the job is done?
Here is what I'm running:
$ time find -exec chmod o-r '{}' \+&
I would like to know how long the job took and be notified when it is ...
2
votes
1answer
189 views
How to add new path to $PATH variable in a post-installation script of RPM?
I want to automatically add a new path to the $PATH variable each time when my RPM package is installed.
I tried to use a post-installation script in the my RPM. Here is the part of RPM spec file ...
0
votes
4answers
145 views
Calculate disk space occupied by many .png files
I have 357 .png files located in different sub dirs of the current dir:
settings# find . -name \*.png |wc -l
357
settings# find . -name \*.png | head
./assets/authenticationIcons/audio.png
...
2
votes
2answers
111 views
Redirect STDERR separately for the shell and the program
I'm doing some audit automation, this example describes checking the version of Java, even though other programs do the same thing.
The output of "java -version" goes to STDERR, which is easily ...
3
votes
1answer
541 views
Encoding to base32 from the shell
I'm looking to encode an input string to base32 encoding directly from the shell. I'm looking to do this in ubuntu, but I imagine flavor doesn't particularly matter here.
Are there any existing ...
3
votes
2answers
96 views
How to Update Text in File within Unix Shell Script
I'm creating a shell script that needs to update the sudoers file. So basically I want to be able to append ":/usr/local/bin/" to the following text in /etc/sudoers:
secure_path = ...
2
votes
2answers
196 views
Shell background processes: what do characters in termination message mean?
I had three background processes, and here's what I've got:
[1] Done zcat jan.txt.gz > j
[2]- Done zcat feb.txt.gz > f
[3]+ Done ...
1
vote
2answers
141 views
Unix to run commands repeatedly on shell without using crontab
Say if I need to run a command checkstatus --jobnumber 12345 to check the job status. The command prints out the info to standard output. Is there any way to run this command on shell repeatedly every ...
0
votes
1answer
73 views
Directory replication in New server
Scenario is to replicate all the directories,sub-directories,files,symbolic links present in Linux development Server to Linux QA Server.
Lot of unix users also to be created.
Consider an unix ...
1
vote
1answer
175 views
How to issue an rsh command in the background?
How to issue an rsh command to run in the background?
Example:
within a batch file i call
rsh 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh
which runs on a remote unix machine. This script takes a ...
-2
votes
4answers
184 views
Need to get server bandwidth usage up to the moment (in bytes)
I am writing a CRON/PHP script that will check the server stats every 5 minutes (CPU/RAM/SSD) and log the info to the database. This way I will be able to see server usage over different periods of ...
0
votes
2answers
264 views
Issues with echo commands?
I run this script as quanta suggest me
#!/bin/bash
EDATE=$(tail -1 a | awk '{ print substr($4, 2, length($4)) }')
EEPOCH=$(date -d "$(echo "$EDATE" | awk 'BEGIN { FS = "[/:]"; } \
{ ...
0
votes
3answers
73 views
problem with loop in shell
I have a problem with loop , I used while in my script as below :
while read LINE
do {
}
done
but the problem is each time I should press enter while running the script, and it supposed to do this ...
0
votes
2answers
242 views
extract information from a log file
I wrote a bash script to extract a few Items like the IP addresses that makes the most number of connection attempts, now I want to limit all of this within a time range , lets say the last 5 ...
-1
votes
3answers
124 views
Determine all users on the Linux machine [duplicate]
Possible Duplicate:
How to list all users and groups on linux?
How to determine all the users on a Linux machine (not only the ones who are logged in)?
I searched and found the following ...
0
votes
1answer
118 views
Debian terminal caching executable paths?
It appears that Debian 6.0.2.1 terminal caches path of executables, which is avoiding fresh executables to be run on the same terminal. I would like to know if this is a feature and if so, how to ...
0
votes
2answers
252 views
Cron process not starting
I have an ec2 image created with cron jobs.
These jobs fail to run; I discovered the cron process in itself has not started. So, I included /usr/sbin/cron in /etc/rc.d/rc.local and created another ...
2
votes
5answers
521 views
How can I track growing directories?
I have a system that continually runs out of disk space. Im going to write a script that cleans up directories that grow larger. Usually these are log directories. Given the nature of the machine, i ...
2
votes
2answers
1k views
“No space left on device” with FreeBSD
When I login with root, and run "mkdir test", the system says "No space left on device". But if I login with other user, it goes well.
[/root]df -h
Filesystem Size Used Avail Capacity ...
0
votes
1answer
109 views
Declare my own script to execute file
I have two files, the first is 'ax':
#!/usr/bin/env zsh
print "Params: $*"
cat $*
And another one 'tst':
#! /home/me/ax
A
B
C
When I am in sh/csh/bash shell:
> ./tst
./tst: line 2: A: ...
1
vote
5answers
324 views
Web-based *nix shell
is there any solution like LogmeIn consisting on a small client to install upon a *nix machine and hence being able to use its shell from the browser bypassing proxies because it all will work on :80?
...
3
votes
3answers
537 views
sh script to remove just txt files using find and exec rm warns me of missing argument to exec
find /full/path/dir -name '*.txt' -exec /bin/rm {} \;
Fine in a shell, but pop it in a sh script along with some similar lines, to get it to run nightly from a cronjob, and it reports:
find: ...
0
votes
1answer
203 views
How can i acess a shell of a jail on FreeBSD?
I have access to a a previously set up FreeBSD box with a number of jails on it. One of the jails is an SQL server and does not have ssh enabled on it.
How can i gain access to a shell on that sql ...
2
votes
6answers
2k views
Most effective way to change Linux command prompt for all users?
I have several machines and the hostnames are really long.. i.e. companyname-ux-staging-web1.companyname.com. So my prompt looks something like
[root@mycompany-ux-staging-web1 ~]#
I'd like to ...
1
vote
6answers
219 views
Teaching total beginners who prior worked with Windows only bash?
I'm supposed to give an introduction to using the shell (i.e. bash) to total beginners. Which is the most basic/useful stuff I can teach someone within 1 1/2 hours without demanding too much?
Here ...
1
vote
2answers
115 views
same shell environment in all accounts
What would be the best way to get the same shell environment (paths excluded) on all my accounts automatically?
What I want is something that transfers the aliases, coloring, and other cool shiznit I ...
1
vote
5answers
453 views
Ubuntu server: manually changed /etc/passwd shell for my user, now can't login
I attempted to change shell from bash to tcsh via editing /etc/passwd file directly.
Yeah, dumb move. I guess I've learned my lesson.
Now I can't SSH into the remote server.
Any way to fix this?
PS. ...
0
votes
2answers
174 views
See which directory takes space without considering other mountpoints
I often find myself having to clean up some directories because they are too full. Let's take /var as an example, as it is a common one, for obvious reasons.
In order to see which sub-directories ...
1
vote
1answer
229 views
Picking a single line from a text file by its line number
In a Unix shell, how can I pick a single line from a text file by its line number?
Say I want whatever is at line 3 in animals.txt to be written to stdout (bat bat bat).
monkey monkey monkey
cat cat ...
0
votes
2answers
3k views
How to tell wget to use the name of the target file behind the HTTP redirect?
Let's a consider link such as htttp://www.mysite.net/download.php?id=267 that redirects to htttp://www.mysite.net/downloads/myfile.tar.gz
If I execute 'wget ...
3
votes
2answers
2k views
Unix separate multiple commands which has '&' (execute in background) in the end
To separate regular commands in Unix is to put semicolon in the end like this:
cd /path/to/file;./someExecutable;
But it seems not working for commands like this:
./myProgram1 > /dev/null &
...
2
votes
3answers
17k views
Most simple way of extracting substring with regular expression in Unix shell?
What's the most simple way to extract substring on Unix shell (with regex)?
Simple means:
less feature
less options
less study
1
vote
1answer
959 views
use SED recursively in linux?
I want to implement the following command recursively
sed -i 's/href=\"1\//href=\"\/1\//g' ./*
so that it replaces all href="1 with href="/1 in all sub-directories. Is there a flag I can add to ...
5
votes
7answers
5k views
Unix shell: easy way to get IP from hostname
What is the easiest way to get the IP from a hostname?
I was thinking about trying a ping and parse it from the output. However, that doesn't seem very nice and will probably not work the same way on ...
2
votes
2answers
121 views
Safely deleting all files of a given name
On Mac OS X, .DS_Store files seem to contain custom view settings for the directory when it is viewed in Finder (file manager GUI). I want every directory to use my default view settings.
Is this ...
3
votes
2answers
235 views
How do I shortcut and not type “python”?
RIght now, I type "python myfile.py" to run it.
How can I type "py myfile.py" to run it?
Or better, do this ./myfile.py?
Any tips?
3
votes
2answers
214 views
unix script problem
I have a simple script which runs on a FreeBSD machine with the following code:
#!/bin/sh
`sed -i .bak '\:#start 172.0.0.3:,\:#end 172.0.0.3:d' /usr/local/etc/racoon/racoon.conf`
echo $?
It should ...
2
votes
2answers
414 views
How do I clear history of the bash logs? Also, do not log any of my users' bash logs?
How do I do that?
I want to clear everything as well as not log anything from now on.
15
votes
6answers
9k views
What does 'set -e' do, and why might it be considered dangerous?
This question has appeared on a pre-interview quiz and it's making me crazy. Can anyone answer this and put me at ease? The quiz has no reference to a particular shell but the job description is for a ...
3
votes
3answers
515 views
Faking the date for a specific shell session
I'm certainly trying to achieve something weird here, but I want to fake the date locally for a shell session on GNU/Linux.
I need to black-box test how a program behaves at different dates, and ...
1
vote
1answer
47 views
Automatically mount partition when needed
Can anyone suggest a method of mounting a partition (e.g. an NFS share) when a user changes into the directory it is set to be mounted to, and not on the system startup?
So far I've been unable to ...
5
votes
6answers
3k views
Monitor the shell activity of a user on your Unix system?
Trust, but verify.
Let's say I want to hire someone a sysadmin, and give them root access to my Unix system.
I want to disable X windows for them, only allow shell usage (through SSH, maybe), so that ...