0
votes
0answers
11 views

Convert rgba color value to a Terminal supported color

Randomly I will take the following example: rgba(122, 143, 186, 0.54) How can I convert this color to the closest Terminal supported color?
1
vote
1answer
60 views

How to check for a folder inside a particular folder in shell script?

I am working on a shell script and python script as well. Python script is passing certain parameters to my shell script and then I am using those parameters in my shell script. Below is my shell ...
0
votes
0answers
20 views

wget failing when I enter variable name in command

I have a small bash script to download a file from my webserver. I pass the $File variable through the command line and then insert it into the wget command as follows: File=${1} wget -a ...
4
votes
2answers
76 views

How to kill a process started as daemon?

I start a process using foo &. It outputs something like: [1] 16915 This is the process id, I guess. How can I store this number into a variable named MY_PROCESS_ID (for example)? Then I ...
0
votes
2answers
53 views

What are ways to encrypt a password inside an environment variable

I have this file I use to set my username and password before exporting the value. #!/bin/bash echo -n "User:"; read user echo -n "Password:"; read -s password export ...
3
votes
1answer
56 views

Init script leaves thousands of defunct processes

My problem is that I have an init script that is generating thousands of defunct bash processes. My goal is to have a program called "fr24feed" in its own screen session on boot. After looking at ...
5
votes
3answers
185 views

Why do I need a tty to run sudo if I can sudo without a password?

I have configured sudo to run without a password, but when I try to ssh 'sudo Foo", I still get sudo: sorry, you must have a tty to run sudo. Why does this happen and how can I work around it?
1
vote
0answers
65 views

Kill Command in linux using bash script [migrated]

I have a bash script abcd.sh,in which I want to kill this command(/usr/local/bin/wrun 'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat') after 5 sec but in this script it kill sleep command after 5 ...
-1
votes
2answers
68 views

Add users from dat file

I have a dat file with names. These are the names of users I must add, without groups or passwords. Ofcourse i have to remove all spaces. I have to add them with a bash script. Can anyone help me ...
1
vote
2answers
55 views

difference between “ls –alR /” and “ls –alR / &”? [duplicate]

What is the difference between "ls –alR /" and "ls –alR / &"? I seem to get the same out put. but the & sign i think should run it in background?
5
votes
4answers
169 views

Run a command when system is idle and when is active again

I want to run a command when the user becomes inactive (the system is idle). For example: echo "You started to be inactive." Also, when the user becomes active again (the system is not idle ...
1
vote
1answer
56 views

Not able to copy multiple files using rsync 3.0.9 version?

I am trying to copy two files using rsync from a machineB but somehow it always copies only one file but not the second file - Here is the syntax I am using - rsync -avz ...
1
vote
1answer
21 views

Using 'find' to email me those files modified recently

I'm using 'find' at the end of a script to email me any .log files in the current directory that have been modified in the last 6 hours. I need this because the file names change so I can't be any ...
0
votes
2answers
43 views

Running Commands on Remote Linux Server Using SSH

I am writing a Bash Script wherein I need to run some set of commands on a remote Linux server from my local computer using SSH. I want the results to be displayed on the terminal screen or dump the ...
-2
votes
2answers
63 views

Run command automatically after login?

Another quick question. I have installed f.lux on Ubuntu 12.04, however the program refuses to work unless I run a command xflux -l [longitude] -g [latitute] -k [temperature] So I've created an ...
2
votes
3answers
150 views

How to use rsync or scp to efficiently copy the files from machineB and machineC to machineA?

I am running my shell script on machineA which copies the files from machineB and machineC to machineA. If the file is not there in machineB, then it should be there in machineC for sure. So I will ...
1
vote
2answers
78 views

How to find out all the files in other machines using bash shell script?

I am trying to find out which files are in machineB and which files are in machineC. And I need to run my shell script on machineA to figure out which files are in machineB and which files are in ...
3
votes
1answer
51 views

ext4, why 70k file takes 88 blocks

[root@xx]# cat -n create_extents.sh 1 #!/bin/bash 2 3 if [ $# -ne 2 ] 4 then 5 echo "$0 [filename] [size in kb]" 6 exit 1 7 fi 8 9 ...
0
votes
3answers
100 views

Resolving MAC Address from IP Address in Linux

I need to write a bash script wherein I have to create a file which holds the details of IP Addresses of the hosts and their mapping with corresponding MAC Addresses. Is there any possible way with ...
1
vote
1answer
71 views

How to exit out of the shell script successfully so that python subprocess think it is successfull exit? [closed]

Below is my shell script which simply execute a url like this http://example.com:8080/beat and parse the response and verify certain conditions on it. If that condition is met, then exit successfully ...
0
votes
1answer
49 views

When executing a command, it is automatically suspended

The problem happened on one of my local machines with CentOS 6. I ssh to it from my MacBook trying to test a script, which is in /usr/local/bin. However, whenever I tried to execute the command, it is ...
4
votes
1answer
204 views

Changing a file's “Date Created” and “Last Modified” attributes to another file's

I'm using merge cap to create a merge pcap file from 15 files. For the merged file, I have changed the name to that of the first of the 15 files. But I would also like to change the merged file's ...
1
vote
1answer
93 views

syntax error in conditional expression while executing the shell script?

I am working on a project in which I need to make a url call to one of my server from the bash shell script.. http://hostname.domain.com:8080/beat After hitting the above url, I will be getting the ...
-1
votes
1answer
42 views

Remove directory without `rm -r`

How to remove non-empty directory without using rm -r or find -delete ? I think it is related to unlink, perl or inode
2
votes
2answers
127 views

Allow NonRoot User to Mount a Particular NTFS External Hard Drive

I have a 4TB external hard drive connected to an Linux server. The fstab permissions on this drive are set so that only one particular non-root user has access to it: ...
3
votes
3answers
218 views

Transform a directory into file or a file into directory

I wanted to create a file named test. Accidentally I run mkdir test instead of touch test. Is it possible to convert test directory in a file named test? What about converting a file named test into ...
1
vote
2answers
63 views

Auto answering password for OPENSSL using HEREDOC [closed]

I have the following command but it doesn't work for me... cd /etc/postfix/ssl/ && openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024 <<PASS password password PASS The output ...
4
votes
2answers
353 views

Where is a shell script run from?

I have a shell script in /usr/bin. Let's call it hello. It contains this: echo "I am located in $PWD" echo "I am called from this directory: ???" Running hello from /home/Documents I expect the ...
3
votes
1answer
132 views

adduser: Specify only one name in this mode

I'm trying to add a user with this command on my debian server: #!/bin/bash APPUSER="test1" APPGROUP="test2" # User adduser -c 'uwsgi user' --group $APPGROUP --system --no-create-home ...
1
vote
0answers
24 views

Why am I not receiving any system e-mails? [closed]

In my crontab, I have the following: * * * * * sh /home/rimmer/test.sh In /home/rimmer/test.sh I have the following: #!/bin/bash echo 'test'; I have also set chmod +x /home/rimmer/test.sh, of ...
2
votes
3answers
78 views

Installing crontab using bash script

I have created a script to install two scripts on to the crontab. #!/bin/bash sudo crontab -l > mycron #echo new cron into cron file echo "*/05 * * * * bash ...
2
votes
2answers
92 views

Command Line Photo Organiser Like Shotwell but to run on headless server

Does anyone know of a program (or even bash script) that can take photos from various folders and then consolidate them into one place and organise them into a directory structure by date in the way ...
2
votes
1answer
33 views

Load application with module load and specify a different name from the default [closed]

I am using my local workstation to run applications stored on our local cluster. To load and run an application, I normally use: module load xxx However, there is a an application on my computer ...
1
vote
1answer
38 views

Debian, nonroot, cron, bash script and rebooting at specific time

As nonroot user, how can I schedule a reboot every day at 4:30am? 30 04 * * * /home/user/scripts/reboot.sh As a nonroot normal user, I'm sure the system won't allow me to use the reboot command. ...
0
votes
1answer
38 views

Is it a bad idea to keep scripts in /root? [closed]

Is it a bad idea to keep scripts in /root? Simple bash scripts that have the following permissions: -rw-r--r-- They execute fine when ran as root, but is this bad practice? It's a multi-user system, ...
1
vote
0answers
8 views

Bash in php exec don't color png and mp3 files on Linux [duplicate]

I have code like this: header("Content-Type: text/plain"); exec("/bin/bash -c 'ls --color=always'", $result); echo implode("\n", $result); and I've got result: Makefile README Yann Tiersen - ...
0
votes
0answers
262 views

Combine multiple CSV files as a Single Multisheet Excel file in Bash [on hold]

I need to convert multiple .csv files as a Single Multisheet Excel file in Linux using bash. Example: I am having Few .csv files like file1.csv file2.csv .... file80.csv. Is there any solution to ...
7
votes
2answers
177 views

Kill a process if it goes quiet for a certain amount of time

I have a utility that has a nasty habit of going quiet and staying there, I already know how long into the process it does this so I am using timeout to fight this, but sometimes it does it before ...
1
vote
1answer
27 views

How can I add autocomplete for “gem which” with rbenv?

I am using rbenv on Mac OS X. I have autocomplete functionality already for the gem command: $ gem build environment lock query stale cert fetch ...
4
votes
2answers
133 views

Dump process's stdin and stdout

I have two processes, let's say Parent and Child. Parent launches the Child and communicates with it through child's stdin and stdout. Parent <-> Child These processes use text protocol and I ...
2
votes
1answer
54 views

Where do I place commands to automatically be exported for all users?

I have an embedded platform running an Arago linux distribution. Right now the only "user" is root but there will eventually be others, but I don't know how many or what user IDs they will have. ...
0
votes
1answer
138 views

Basic script in Angstrom Linux running on a Beaglebone Black

On my embedded system, I can toggle a user led with: echo > 1 sys/class/leds/beaglebone:green:usr2/value. Similarly, I can find the value of a GPIO (gpio60) (set to input), with more ...
2
votes
1answer
77 views

Launch a command at the end of Linux startup

I have a Raspberry without screen/keyboard/mouse that does nothing else than launching a radio stream at startup : mplayer http://95.81.146.2/fip/all/fiphautdebit.mp3 I have put this command at the ...
0
votes
0answers
15 views

Restore system with no execute permissions for bash and chmod [duplicate]

Good day everyone! One of my friends asked me a question: how to restore an unbootable Linux system (let it be CentOS or whatever) in the following situation: no execute permissions for bash no ...
0
votes
1answer
40 views

How I append the data of Multiple files into one file?

I want to append data of approx 500 files into one file and each of these files are located in their respective dirs. Also How i can verify the contents of merged file e.g How i verify that data ...
0
votes
1answer
17 views

Preventing a new instance of a program to open when calling it

My problem is with FBI (frame buffer image viewer) for Linux, but my question and any answers are perhaps applicable to more than only that program. I don't know. Anyway… While things are loading on ...
0
votes
2answers
103 views

Deleting large number of files

I'm writing a script to delete large number of files in linux. The script will run every two minutes in crontab. I tried using the find /mnt/md0/capture/DCN/ -maxdepth 1 -type f -name "*.pcap" ...
0
votes
2answers
109 views

How do I run two ongoing processes at once in linux/bash?

I would like to know how I can run two ongoing processes at the same time in Linux/bash. basically, I have a Node web server, and a MJPG-Streamer server. I want to run both these processes at once, ...
2
votes
2answers
132 views

How do I share stdout between multiple processes?

I want to receive live TCP stream, and make it readable by another processes at the same time, without saving it. For example, 111.222.233.244:1234 streams actual time. Server supports only one ...
0
votes
1answer
20 views

Zenity refuses to work in background

I'm trying to create a background bash script which creates a popup in certain circumstances, however, my code only works when run manually in a terminal (e.g. not in the background). I've tried ...