Questions tagged as 'shell-script'

0
answers

command not found

Another newbie question echo "Enter an integer number" read int checkNum=$(( int % 2 )) if [$checkNum -eq '0' ]; then echo "the number is even" else echo "the number is odd" fi Error when entering any number:    ./ test4.sh: line 9:...
asked by 09.12.2017 / 06:50
1
answer

Opening Shell script in Python

I'm automating tasks and I'm new to Python, so I'd like your help because I need to run a Shell script on another machine and this command I need to give inside a Python code. I thought about using something like: #!/usr/bin/python # -*-...
asked by 01.08.2017 / 07:37
0
answers

Find only one value via shell script

Galera, I am creating a script to fetch a value, however, within BDD there are repeated values and I would like to fetch only one of each. For example, there are several drives for each state, but I want to fetch only the main drive. They are...
asked by 28.06.2017 / 21:05
1
answer

Shell: Sorting file whose name contains white space

Using shell script, I am creating a script.sh file that automates some tasks for me. In it I need to sort a file from the current directory to perform some tasks. I am raffling the file with the command below: shuf -n1 -e $(ls) The c...
asked by 17.04.2017 / 22:20
2
answers

My code shell script does not list all user processes

Why does not my code list all user processes? I made a script to delete processes from a user, it's exercise ... Well basically I made a whoami and I got into a variable, after that I made a ps -aux | egrep $ variable, and it returns processes b...
asked by 31.03.2017 / 02:47
2
answers

How to run scripts in CentoS startup?

Good afternoon, how do I run a script on CentOS 6.5? I'm running on /etc/rc.local /etc/rc.d/rc.local and is not loading commands: sh /etc/init.d/script The command works outside the script.     
asked by 24.06.2015 / 21:36
2
answers

Automation of tasks in linux [closed]

Well, I already know python and I know that it is very good for working with scripts and automation of tasks but my question is, I can work comfortably with administration and automation of linux and database environments only with python or is...
asked by 27.05.2018 / 16:06
2
answers

Using MKDIR via shell script [closed]

I'm trying to create a directory via shell script, using the command: mkdir -m755 "/var/www/app.dominio.com/html/$1" Where the folder name is passed by parameter, you are getting a question mark "folder_name?" at the end and it is inaccessi...
asked by 17.08.2018 / 03:00
1
answer

Delete "," in the first and last line of a CSV

I have a csv that is exported like this: +++ Host - Begin +++,, Name,Description test1,abc2 test2, abd3 +++ Host - End +++,, How do I get this result? +++ Host - Begin +++ Name,Description test1,abc2 test2, abd3 +++ Host - End +++     
asked by 25.10.2017 / 13:23