Why sudo cat gives a Permission denied but sudo vim works fine?

Bash
I am trying to automate the addition of a repository source in my arch's pacman.conf file but using the echo command in my shell script. However, it ...
1 year ago

Too many arguments error while using shell script on cygwin

Bash
I am trying to run a script on cygwin prompt. ssh-keygen -t rsa $email eval $(ssh-agent -s) ssh-add ~/.ssh/id_rsa mkdir -p /proj/env ln -s /usr/bin/p...
1 year ago

delete files in a sequence and count in shell

Bash
In a specific unix directory on a server. I would like to list down files and delete them in a sequence one by one. Below program is showing errors i...
1 year ago

Shell script to capture Process ID and kill it if exist

Bash
I tried this code and it is not working #!/bin/sh #Find the Process ID for syncapp running instance PID=`ps -ef | grep syncapp 'awk {print $2}'` i...
1 year ago

Default values to a unix shell script?

Bash
Normally when a parameter is passed to a shell script, the value goes into ${1} for the first paramater, ${2} for the second, etc. How can I set th...
1 year ago

Redirecting stdout with find -exec

Bash
I would like to merge all the files under a folder and its subfolders into a file total.txt, so I try find . -type f -exec cat {} +; > total.txt ...
1 year ago

Adding text after variable expansion - Fish

Bash
I want to add text after variable expansion, but fish thinks I'm referring to a different variable name e.g. $ set dessert "cake" $ echo $dessert cak...
1 year ago

Shell script to call daemon - DAEMON: command not found

Bash
Currently I can start a custom server like this: cd /home/admin/service/build && ./service visual.dat I'm trying to make a shell script to ...
1 year ago

bash variables in Python

Bash
I have a python script conve_cal.py which take 7 arguments as follow: enter code here import numpy as np import sys def read_file(filename1,filename...
1 year ago

How to start Genymotion device with shell command?

Bash
I need to start genymotion via shell command, does anyone know if it is possible to do this?
1 year ago

Using shell variable in awk

Bash
I am new to awk and need some help this works awk '{ for(i =0;i<10;i++){ if ($27 == 'addr1') { print >"temp.csv" } } }' /tmp/inpu...
1 year ago

Run Python for Android (Qpython) in Android Terminal

Bash
Python for Android (Py4A 2.6) is wonderful!!! But QPython (2.7) is a lot more powerful and continuously developed. Now I try to integrate Qpython's Py...
1 year ago

find command: get files from a start date, with multiple extensions

Bash
When I run this command find /home/pi/Transmission_Downloads/ -type f \( -name "*.mkv" -o -name ".mp4" \) -newermt "2015-12-11" I was expecting to ...
1 year ago

shell scripting: how to pass 2 parameters in for loop?

Bash
I'am creating a shell script, where in I need to pass two parameters (like hash tags) in for loop. for ex. (key value) here I'm comparing "value" para...
1 year ago

How to get the process id of a bash subprocess on command line

Bash
I know in bash we can create subshells using round parenthesis ( and ). As per bash man page: (list) list is executed in a subshell environment ...
1 year ago

Check if database exists in postgreSQL using shell

Bash
I was wondering if anyone would be able to tell me about whether it is possible to use shell to check if a postgresql database exists? I am making a ...
1 year ago

Pentaho generic error handling script

Bash
At this moment I am trying to make a generic error handling script using Pentaho. So far I've found some information about Shell scripts but they do n...
1 year ago

How to find Linux Distribution name using shell script?

Bash
I am writing the shell script in which I need the current operating system name to make it generic. Like. if [ $Operating_System == "CentOS" ] then ...
1 year ago

Store / Capture stdout and stderr in different variables (bash)

Bash
Is it possible to store or capture stdout and stderr in different variables, without using a tempfile? Right now I do this to get stdout in out and s...
1 year ago

Mount 500Gb disk

Bash
Bash script to mount the 500Gb WD drive.
2 years ago