Questions tagged as 'shell'

1
answer

How to pass filename with accent and spaces as parameter to shell script file

I densenvolvi a shell script that receives the location of a file and makes various manipulations on it, eg: ./processa.sh path / file.txt But when I send a file name as a parameter that contains spaces, it gives error, because it places '\'...
asked by 16.09.2014 / 01:58
2
answers

How to find out what is a file and what is a directory

The question is as simple as the logic I have here. Logic: Assuming that files should always contain your .png .txt suffix etc ... While folders / directories take nothing but their plain name The idea is to get these referenced name...
asked by 13.03.2018 / 17:20
2
answers

Shell of Python and Django

I know that to open the Python interactive shell, we simply run it on the terminal of the operating system: python But with Django installed, you can also open the shell using the command: python manage.py shell Is there any difference...
asked by 25.05.2017 / 16:30
3
answers

html shellscript table

Well, does anyone know how to create this script request in the image below? I'm doing some exercises with the theme, and this medium that got me.     
asked by 27.10.2016 / 01:14
1
answer

How do I know if script command was executed successfully?

I need the script to identify if the tar.gz file was successfully generated in an if. Here is a nonfunctional example: VAR=tar -zcf teste.tar.gz teste/testeDir if [VAR] then echo "Sucesso" else echo "Erro" fi Pretty simple I think but I cou...
asked by 29.07.2016 / 20:14
1
answer

What kind of recursively remove accented characters from file names

I tried other scripts I found on the internet (* the ones I found), but without success. So I want to know from some of you how to do this automated / recursive task. Shell Script Retrieved from: link set meta-flag on set output-meta on...
asked by 23.08.2018 / 23:15
2
answers

Call cd command in c ++ using system ()

I'm trying to "program a shell" inside C ++ but I'm not able to use the cd (path) command it just will not, I searched and saw that when I use system() a new shell is created outside the directory we are in so I can not use it, what would...
asked by 21.06.2017 / 21:27
2
answers

exec does not work - apparently executes the same call file

I have a lengthy script that prevents other processes from running while it does not finish. As a workaround, I decided to create a file that executes it with the exec ( mkt-start.php ) command. So: exec('php -f mkt-exec.php > mkt.log &a...
asked by 13.03.2017 / 17:00
1
answer

How to redirect all the bash script inside the script itself?

I need to play the output of it in a file instead of playing in the standard output that is the screen but without having to explicit with the command >> in the terminal, I want the script itself to do this.     
asked by 23.07.2018 / 00:42
2
answers

How to renumber recursively numbered files, giving name to other files

What I am currently looking to do is rename all files in a folder, where there are also other files of different format. See the example: PASTA - BEFORE 1.txt 2.txt 3.txt Daniela.jpg Amanda.jpg Lucia.jpg What I can not do is exactly...
asked by 31.01.2018 / 21:51