2
votes
2answers
193 views

bash script.sh vs http://superuser.com/script.sh vs #shebang

Assuming i am in a bash shell now and i execute the following[me@server]$ bash script.shq1) Is a new child bash process created to execute the script ?If i do a [me@server]$ http://superuser.com/script.shq2) ...
0
votes
2answers
396 views

Empty /var/log after running cron bash script

I wrote a little bash script and all of a sudden my /var/log folder is completely empty except for the log I created for the bash script.This is the script I'm running every hour with cron:#!/bin/...
-1
votes
2answers
200 views

formatting output in bash shell to remove special characters - linux

I am issuing the command below against a logfilegrep "Oracle Audit" /var/adm/messages | awk '{print $6}'How do I format the below outputAudit[9460]:Audit[10507]:Audit[10507]:Audit[10507]:to ...
2
votes
1answer
81 views

Running a process in the background using &

I have created the following script:#!/bin/bashwhile :doecho "1" >> test.txtsleep 1doneIf I run the command using http://superuser.com/exm.sh & it runs on the background as expected and it ...
1
vote
1answer
445 views

Linux - create screen as another user

I'm trying to create a new screen on my server (CentOS 5.11), but instead of starting it with my user, I would prefer to use another user with restricted permissions, just to be on the safe side.So, ...
1
vote
1answer
2k views

bash: /home/user/.bashrc: Permission denied when try to change user from root to user

I'm on centos, when I login as root and use su x to change user to x, it shows this:bash: /home/x/.bashrc: Permission deniedI try to source ~/.bashrc but nothing changes and I also tried following ...
1
vote
1answer
190 views

redirection - why it doesn't work this way

I know there are 3 streams attached to a process when it is run namely the input, output and error stream.And redirection execution work from left to right.I intend to execute a command, redirect ...
0
votes
1answer
219 views

Run jpegoptim in a cronjob once a week, on CentOS from within cPanel, only for files added within the past week?

I've installed jpegoptim and can manually run it via the SSH command line:jpegoptim *.jpg --strip-allI'd like to take that command line and put it into a Cronjob that runs once a week. I'm running ...
0
votes
1answer
1k views

How do I run Asterisk as user other than root?

I compiled Asterisk 11 from source as user root on CentOS. Now I want Asterisk to run as user asterisk group asterisk. I have uncommentedAST_USER="asterisk"AST_GROUP="asterisk"in/etc/sysconfig/...
0
votes
1answer
159 views

CentOS bashrc function to email on login

I've a system setup where an email is sent on a user login (line from .bashrc): printf "user details, ip etc" | mail -s "[LOGIN NOTICE] `hostname` - `whoami`" <admin>@<domain>.co.uk...
0
votes
1answer
866 views

Associate MIME Type with Shell Script?

I want to associate any file type with a .abc extension with the following shell script:#!/bin/bashecho arg 1 is: $1The .abc type files just have text, but I want to ensure that opening a file ...
1
vote
0answers
38 views

CentOS - using PXE to install it on my host ( kickstart configuration )

I am trying to install an OS from our server through PXE ( Preboot Execution Environment ).However, on my host, I have two disks say A ( /dev/sda ) and B ( /dev/sdb )The default installation path ...
1
vote
0answers
1k views

execl: couldn't exec `/bin/sh'

I accidentally moved the whole bin, boot, dev and etc directory.After moving everything back I get the following error email from various cron jobs:execl: couldn't exec `/bin/sh'execl: No such ...
1
vote
0answers
260 views

xdotool : close all windows except the one that is active (infront)

I would like to execute a command that will closeall windows except the one that is currently active.i would likely to place this command in the gnome-panelwhich means when i click on the button, ...
0
votes
0answers
9 views

source bash command redirection between aws linux and macos

I want to redirect the output of a subshell into source. So for example:say.shecho "hello"source_test.sh#!/usr/bin/env bashsource <(cat http://superuser.com/say.sh)When I run http://superuser.com/source_test.sh, this prints ...
0
votes
0answers
44 views

Startup script unexpected results

I'm experimenting with a small script to setup my webserver on Vultr. This is a "Startup script" that is used by Vultr on the background after deploying a new machine for me. If I run manually with ...