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

0
votes
1answer
471 views

APC Network Shutdown script on vMA

I'm trying to configure the APC Network Shutdown script for 3 ESX hosts, and it doesn't seem like I can run my test script on my vMA appliance. I'm trying to verify I've set it up correctly using a ...
-1
votes
1answer
248 views

filenames, ASCII unicode escaped sequences to UTF8 [closed]

I'm not sure if I've grasped the issue here so if I haven't just say so and I'll edit the title. My problem is the following: I have an Ubuntu 12.04 server (UTF-8 locale) to which users upload files ...
0
votes
4answers
256 views

Move files to subdirectories: /img/ab123.jpg --> /img/ab/ab123.jpg

I have a linux webserver with about 25.000 images in one directory. They are all lowercase and in the format two letters, three digits and jpg as the extension. Because that many files in one folder ...
-1
votes
1answer
732 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
0answers
26 views

Running command from script won't give desired output

If I run sudo /usr/lib/update-notifier/apt-check -p &> ~/update-list.txt directly on terminal, I get the update-list.txt file with all the updates in it. But if I write the same command in a ...
2
votes
1answer
154 views

Where is $HOME set in Centos 6.3

WHere is the $HOME environment variable set in Centos 6.3? I've looked in: /etc/profile /etc/profile.d/* /etc/bashrc ~/.bash_profile ~/.bashrc Also, the second to last column in /etc/passwd has ...
0
votes
1answer
454 views

Linux how to run a script in the background on a remote server? [closed]

I'm on a linux machine. I would like to run four perl scripts on a remote server. Each script produces a single output file but it can take hours to run. I would like to run the scripts in the ...
0
votes
0answers
227 views

shell command queuing system linux (like atd)

I need to queue shell commands depending on current available resources. I know of atd and it's exactly the type of tool I would like to find but with consideration for RAM and possibly disk ...
1
vote
2answers
112 views

Exporting paths and configs in ubuntu

I am trying to add some exports using the following method: # SETUP CONFIGS sudo bash -c "cat >> /etc/bash.bashrc" <<'EOF' export AWS_CONFIG_FILE=/etc/test/aws.txt export ...
-1
votes
1answer
61 views

How to tar into a directory. [duplicate]

I would like to be able to tar all of my files so that when the are extracted they're in a sub directory I have specified. For example if I have File1 File2 and File3 inside of my current directory I ...
0
votes
3answers
2k views

Cant run rc.local manually and doesn't run automatically on ubuntu

This is quite a simple one. I created an rc.local file here: /etc/rc.local I made it executable. However, it doesn't run when I boot the server. I can see it in the directory and when I try to run ...
0
votes
1answer
391 views

can't access sourced variables inside Upstart script stanzas

I'm trying to use the variables defined in /etc/environment in an upstart script. I'm able to export the variable to the child process but for some reason I not able to use them in the upstart script ...
0
votes
1answer
287 views

Shell - Fix 80 column wrap limit

I have several Centos servers that enforce an 80 column limit when I ssh into them, rather than being dynamic and going to the width of whatever shell I am using as seen here: . Is there a way to ...
0
votes
1answer
233 views

Mysql select query not generating result on cron but is ok via terminal

We have a C program (source is below). We compile it with: gcc -Wall -Wextra -g $(mysql_config --cflags) get1ReceiveSource.c $(mysql_config --libs) -lrt -o get1Receive The select give results ...
1
vote
1answer
97 views

How do I run a shell script only any files are modified in a folder?

I need to replicate a folder over a very slow link to several destinations. Currently I create a text file with find. find "$sourcedir" -exec ls -la {} \; > "$statefile" I then compare it to a ...
1
vote
1answer
419 views

Trying to use sudo with bash subshell: env variables not working

I have read a few other posts, it appears cumbersome to do multiple commands within sudo. Heredocs suffer from limitation of not being able to do redirection of stdin/stdout. Here in any case is a ...
0
votes
1answer
210 views

Attempting to change shell to ZSH on Amazon Linux: Asking for ec2-user's password

What do I enter? I use the provided private-key to authenticate when SSH-ing to the server, so I don't think I actually have a password for the user... Also tried this:
0
votes
2answers
116 views

IPv6 reverse not resolving for Linux shell “last” and “who”

IPv6 is properly resolving in DNS: > host 2607:fa18:0:2::17 7.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.0.0.0.0.8.1.a.f.7.0.6.2.ip6.arpa \ domain name pointer sine.xmission.com. However, the ...
3
votes
4answers
747 views

Download a file from the shell when button click is required

I have a link to a file that I would like to download from the shell. Unfortunately, the URL redirects to a software license agreement page which requires clicking an accept button. This is fine when ...
0
votes
1answer
125 views

Why is dash the new default shell among Debian squeeze [closed]

Can anybody tell me why Debian changed the default shell from bash to dash? I run in different issues with the new shell and I would like to understand what's the cause for this change.
0
votes
1answer
223 views

Remove text between delimiters in linux [duplicate]

Server got hacked and a fair amount of files were edited. We noticed that the code that was inserted were typically done between delimiters (e.g. /*e21234*/ blah blah /*/e21234*/). What is the most ...
1
vote
2answers
463 views

Changed shell and can't ssh login to root account

I used the command usermod -s /bin/fish root to change the root user's shell and now I can't login to my root account. Why is this happening? I am trying to SSH into a server running Ubuntu through ...
2
votes
3answers
127 views

Can I use EC2 as a random Unix shell? [closed]

I have a small, low-cost, VPS that I use for some "grey-beared-Unix-guy shell stuff": basically, hosting a Debian running a XMPP bot, keeping long lived shell sessions with tmux under intermittent ...
2
votes
2answers
455 views

rsync not deleting folders

I have a problem rsyncing my folders. In my home there is folder named "workspace". Recently I changed its content a lot, creating new directories, deleting old ones. New folders were successfully ...
0
votes
2answers
153 views

xargs remove file name containing $

I am using xargs to remove files from remote server. xargs -a /var/log/del.log -i -exec ssh root@abc.com 'rm -rf "{}"' del.log contains path of the files which are deleted on local server and I ...
0
votes
1answer
381 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): ...
2
votes
3answers
2k views

gpg-agent says agent exists, but gpg says agent doesn't exist?

I'm struggling with some issues while scripting gpg with bash on a Debian 6.0.6 box. I have a script that does a batch of operations and wants to make sure that a gpg-agent is available before it ...
2
votes
1answer
73 views

Is there a Linux utility to return an error code for a particular input?

I'm running Puppet, and I need to run one of the defined exec commands only if a line does not exist in the output from a different command. I can set up a contingency with a unless clause (which ...
2
votes
2answers
3k views

ssh root access denied after changing shell

after i tried to change my server shell, i cannot login as root anymore. First, i installed the z-shell (zsh) as root and then i wanted to change it to my default shell. Therefore i used "chsh". My ...
12
votes
2answers
672 views

backslash at the beginning of a command

In Installing RVM manual I see a lot of lines starting with '\': Install RVM with ruby: $ \curl -L https://get.rvm.io | bash -s stable --ruby I'd think it is just mistype but they repeat ...
-2
votes
1answer
486 views

ls: cannot access file : No such file or directory. [closed]

In the shell script, I will have to access the binary logs stored in /usr/local/mysql/data. but when I do this, STARTLOG=000002 ENDLOG=000222 file=`ls -d ...
2
votes
3answers
1k views

Upstart script vs. command-line: why this difference in behavior?

I'm trying to set up Tomcat to start with upstart. I find the following works: description "Tomcat Server" start on runlevel [2345] stop on runlevel [!2345] respawn respawn limit 10 5 ...
-2
votes
1answer
305 views

sh dev/null Permission denied apache

I am using Mac osx Mountain Lion for development. I am trying to execute a shell command in php using the 'exec' function. At the end of my command I am putting the output to > /dev/null 2>dev/null ...
-1
votes
1answer
43 views

Different behavior from ubuntu server and ubuntu client on windows [closed]

#!/bin/bash # Reading cat /home/radiare/Desktop/first.txt | while read LINE do if [ "$LINE" == "false" ]; then echo "Inside first loop" break fi done cat /home/radiare/Desktop/second.txt | while ...
0
votes
2answers
156 views

Debian shell script to update server software

A lot of my server software is installed via apt-get and I was wondering if there is a small shell script I can get which will will update all of this software. Also do I need to restart my server ...
2
votes
2answers
225 views

Appending data to file with a single open/close from a shell script

I need to adjust my shell script and write to $log multiple times. Opening and closing the file repeatedly will cause an increase in runtime. How can I write everything at once to the file, ...
1
vote
1answer
524 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
votes
2answers
385 views

“su” does not work on FreeBSD

Below I sun "su" command on FreeBSD: FreeBSD rand.vstyle.local 9.0-RELEASE FreeBSD 9.0-RELEASE #0 amd64 This is server RAND :) [svn@rand ~]$ su logostudiotest1 /bin/ls Password: /bin/ls: /bin/ls: ...
0
votes
6answers
4k views

Bash script runs manually, but fails on crontab

I'm a newbie to shell scripting. I have written a shell script to do incremental backup of MySQL database.The script is in executable format and runs successfully when executed manually but fails when ...
0
votes
2answers
185 views

Get memory usage in CentOS formatted

What is the best way in CentOS via a shell command to get the memory usage/free memory formatted like: Memory used: 389MB of 1024MB I know about free -m but parsing it, provides a challenge.
1
vote
4answers
75 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 ...
0
votes
1answer
90 views

ZSH escaping / file matching pattern

This works from command line: scp -r ^.git b:/home/wopi/blyzics/. when I paste the above line in a script like this: #!/usr/bin/env zsh scp -r ^.git b:/home/wopi/blyzics/. And run it ...
1
vote
1answer
431 views

Counting the number of flows in a tcpdump file

I have a large tcpdump file which I need to parse to identify the number of flows in the capture based on the ( source ip + source port , destination ip + destination port ) pairs. Does tcpdump / any ...
0
votes
1answer
361 views

replace dates in XML file on a Linux server

I'd like to change the date format in the contents of an XML file from 2013-01-21 to January 21 The following script works on my mac, but not on a linux server (I'll be running it as a daily cron ...
0
votes
1answer
287 views

Error when sending an email from the shell using sendEmail

I'm using sendEmail to send emails using google account .. it is working fine on number of identical servers but on one if the servers it gives me the following error smtp.gmail.com:587 failed: ...
2
votes
1answer
520 views

Can't set TERM permanently in fish shell

I use the fish shell. I'm trying to run vim inside tmux with the solarized theme, but the colors are broken unless I run: set -lx TERM screen-256color-bce; before running tmux attach. It's ...
-3
votes
2answers
410 views

Simplest way to jail users for git [closed]

I'd like to create a couple user accounts on my server such that the users can check out a specific git repository. Ideally, the user would not be able to gain access to a shell or copy any files ...
0
votes
2answers
713 views

Cannot change chmod from bash script

I made a script to copy an image to a temporary directory, convert it to an another format, then move it to a final directory. But i can't get the chmod command to work, the file is copied to the ...
1
vote
2answers
199 views

Making a user account dedicated to a single script in centos

I am trying to make a SSH login for someone on my box. But when they login I want it to auto load a perl script and for them ONLY to be aloud to see / use that perl script. I only know how to use ...
1
vote
1answer
115 views

What shell script is calling rsync? [closed]

For the last couple of days, I've woken up to find rsync churning away with 1.6GB of memory, slowing my Mac down significantly. Activity Monitor only says that rsync is coming from sh, but I'm trying ...