LPI 102 - Shells, Scripting And Data Management 2- Marcus Vinicius Braga Alcantara

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Viniciusalcantar
V
Viniciusalcantar
Community Contributor
Quizzes Created: 11 | Total Attempts: 7,455
| Attempts: 240
SettingsSettings
Please wait...
  • 1/72 Questions

    O comando alias permite que sejam criados aliases de comando no sistema enquanto o comando unalias remove aliases do sistema?

    • Verdadeiro
    • Falso
Please wait...
LPI 102 - Shells, Scripting And Data Management 2- Marcus Vinicius Braga Alcantara - Quiz
About This Quiz

.


Quiz Preview

  • 2. 

    Ao encerrar a sessão do shell, o bash executa as instruções contidas no arquivo ~/.bash_logout, se o mesmo existir.

    • Verdadeiro

    • Falso

    Correct Answer
    A. Verdadeiro
    Explanation
    When closing the shell, the bash executes the instructions contained in the file ~/.bash_logout, if it exists.

    Rate this question:

  • 3. 

    Qual o benefício que proporciona um alias?

    • Ele esconde o comando que você está executando de outros.

    • Ele fornece pesquisas mais rápidas para comandos.

    • Ele evita ter que digitar comandos longos.

    • Ele cria uma cópia local de um arquivo de outro diretório.

    Correct Answer
    A. Ele evita ter que digitar comandos longos.
    Explanation
    An alias provides the benefit of avoiding the need to type long commands. By creating a shorter alias for a command, users can save time and effort by simply using the alias instead of typing out the entire command. This can be particularly useful for frequently used or complex commands, as it allows for quicker and more efficient execution.

    Rate this question:

  • 4. 

    O que a seguinte linha de comando irá retornar: echo "eu sou o usuário: $USER" ?

    • Irá retornar o seguite texto: eu sou o usuário: root

    • Irá retornar um erro de sintaxe.

    • Irá retornar o texto: "eu sou o usuário:" seguido do nome do "usuário atual"

    • N.D.A

    Correct Answer
    A. Irá retornar o texto: "eu sou o usuário:" seguido do nome do "usuário atual"
    Explanation
    The given correct answer states that the command "echo "eu sou o usuário: $USER"" will return the text "eu sou o usuário:" followed by the name of the current user. This is because "$USER" is a special variable that holds the name of the current user in Unix-like operating systems. Therefore, when the command is executed, it will replace "$USER" with the actual username and display the complete sentence.

    Rate this question:

  • 5. 

    Qual palavra está faltando a seguinte instrução SQL? __________ count(*) from tablename;

    Correct Answer
    select
    SELECT
    Explanation
    The given SQL instruction is missing the keyword "SELECT" before the count(*) function. In SQL, the SELECT keyword is used to retrieve data from a database table, and it should be included before the count(*) function to specify which columns or data we want to retrieve.

    Rate this question:

  • 6. 

    Qual diretório /etc é usado para manter uma cópia de amostra de arquivos e diretórios para quando um novo usuário tem um diretório HOME criado ? (Por favor, forneça o caminho completo).

    Correct Answer
    /etc/skel
    /etc/skel/
    Explanation
    The correct answer is /etc/skel or /etc/skel/. The directory /etc/skel is used to keep a sample copy of files and directories that will be automatically copied to a new user's home directory when it is created. This allows the new user to have a pre-defined set of files and directories already in place.

    Rate this question:

  • 7. 

    Por padrão, o conteúdo de qual diretório será copiado para o diretório home de um novo usuário quando a conta é criada passando a opção -m para o comando useradd? (Especifique o caminho completo para o diretório).

    Correct Answer
    /etc/skel
    /etc/skel/
    Explanation
    The correct answer is /etc/skel or /etc/skel/. When creating a new user account using the useradd command with the -m option, the content of the /etc/skel directory will be copied to the new user's home directory. The /etc/skel directory contains default files and configurations that will be available to the new user upon account creation.

    Rate this question:

  • 8. 

    Você está usando uma aplicação que você deseja que apareça na tela de outro computador. Qual variável de ambiente você deveria definir ou editar para conseguir isso?

    • DISPLAY

    • SCREEN

    • REMOTE_XWINDOW

    • REMOTE

    Correct Answer
    A. DISPLAY
    Explanation
    To display an application on another computer's screen, you need to set or edit the "DISPLAY" environment variable. This variable specifies the display server's address where the application should be shown. By setting the "DISPLAY" variable to the appropriate value (e.g., IP address or hostname of the remote computer), the application will be able to appear on the desired screen.

    Rate this question:

  • 9. 

    Que palavra irá completar uma condicional "se" no bash, como o seguinte: if [ -x "$file" ]; then echo $file________(Por favor, forneça apenas a palavra em falta).

    Correct Answer
    fi
    Explanation
    The missing word to complete the conditional statement in bash is "fi". In bash scripting, "fi" is used to close the "if" statement. It indicates the end of the block of code that should be executed if the condition specified in the "if" statement is true.

    Rate this question:

  • 10. 

    Você emitiu o comando: export CFLAGS="-march-i586". Você pode remover esta variável de ambiente usando o comando: ________CFLAGS

    Correct Answer
    unset
    Explanation
    The correct answer is "unset". This command is used to remove or unset a variable from the environment. In this case, the variable "CFLAGS" is being removed from the environment by using the "unset" command.

    Rate this question:

  • 11. 

    Qual dos comandos a seguir aplicam direitos e restrições respectivamente quando do uso da linguagem SQL padrão?

    • add e erase

    • grant e revoque

    • revoque e grant

    • erase e add

    Correct Answer
    A. grant e revoque
    Explanation
    The correct answer is "grant e revoque". In SQL, the "grant" command is used to apply rights and permissions to database objects, allowing users to perform certain actions on them. On the other hand, the "revoque" command is used to revoke or remove those rights and permissions from users. So, these two commands are used to grant and revoke rights and restrictions in the standard SQL language.

    Rate this question:

  • 12. 

    Este shell script irá retornar qual dos valores abaixo?

    • O resultado é 30

    • 30

    • O resultado é: 30

    • Retornará um erro.

    Correct Answer
    A. O resultado é: 30
    Explanation
    The given shell script will return the value "O resultado é: 30".

    Rate this question:

  • 13. 

    Qual palavra está faltando a seguinte instrução SQL ? select count(*) _________ table name;

    Correct Answer
    from
    Explanation
    The missing word in the SQL instruction is "from". The "from" keyword is used to specify the table from which the data is being selected in the SQL query.

    Rate this question:

  • 14. 

    Você percebe que executa uma série de comandos com certa frequência. Você deseja que esta série de comandos esteja disponível em seu login para executar no shell atual.

    • Criar um programa em shell

    • Criar uma função

    • Usar a seta para cima no BASH para localizar o comando

    • Usar a função ! embarcada do BASH para executar a última iteração do comando pelo menos nome

    Correct Answer
    A. Criar uma função
    Explanation
    The correct answer is to create a function. By creating a function, you can define a series of commands that can be easily executed whenever needed. This allows you to have the series of commands available in your login and execute them in the current shell.

    Rate this question:

  • 15. 

    Qual é a diferença entre os comandos test -e path e test -f path ?

    • O test com opção -f para um arquivo regular. O test com opção -e para um arquivo vazio .

    • O test opção -f para um arquivo regular . O test com opção -e para um arquivo executável.

    • Eles são opções equivalentes com o mesmo comportamento.

    • Ambas as opções verifica a existência do caminho. A opção -f também confirma que ele é um arquivo regular.

    Correct Answer
    A. Ambas as opções verifica a existência do caminho. A opção -f também confirma que ele é um arquivo regular.
    Explanation
    The correct answer explains that both options (-e and -f) check for the existence of the path. However, the -f option also confirms that the path is a regular file.

    Rate this question:

  • 16. 

    O que irá realizar o seguinte comando: "export PATH = $PATH: $APPLICATIONS"

    • Todos os usuários do NFS podem montar os aplicativos diretamente.

    • Atualiza o caminho com o diretório de aplicativos.

    • Atualiza o caminho com o valor de $APPLICATIONS.

    • Caminho de mudanças para o diretório de aplicativos.

    Correct Answer
    A. Atualiza o caminho com o valor de $APPLICATIONS.
    Explanation
    This command will update the PATH variable by adding the value of $APPLICATIONS to it. The $PATH represents the current value of the PATH variable, and the $APPLICATIONS represents the value of the APPLICATIONS variable. By using the command "export PATH=$PATH:$APPLICATIONS", the PATH variable will be updated to include the value of $APPLICATIONS, allowing the system to search for executables in that directory.

    Rate this question:

  • 17. 

    Que saída produzirá o seguinte comando seq 10?

    • Um fluxo contínuo de números a aumentar em incrementos de 10 até ser interrompido.

    • Os números de 1 a 10 com um número por linha.

    • O número 10 para a saída padrão.

    • Os números de 0 a 9 com um número por linha.

    Correct Answer
    A. Os números de 1 a 10 com um número por linha.
    Explanation
    The command "seq 10" will produce the numbers from 1 to 10, with each number on a separate line.

    Rate this question:

  • 18. 

    Existe um problema ao se realizar operações matemáticas com o shell bash: Seus operadores só suportam aritmética de números inteiros. Segue um exemplo de um shell script que realiza uma operação de divisão, onde o valor correto a ser retornado seria 4,5, porém o bash irá retonar o valor de número 4. Uma alternativa a ser utilizada para tal problema seria utilizar a calculadora interna do bash (bc).

    • Verdadeiro

    • Falso

    Correct Answer
    A. Verdadeiro
    Explanation
    The given statement is true. The explanation states that there is a problem when performing mathematical operations with the bash shell because its operators only support arithmetic with integers. It provides an example of a shell script that performs a division operation, where the correct value to be returned would be 4.5, but the bash shell will return the integer value of 4 instead. The explanation suggests using the internal calculator of bash (bc) as an alternative solution to this problem.

    Rate this question:

  • 19. 

    Que palavra-chave está em falta a partir deste exemplo de código de um shell script?

    • for

    • while

    • loop

    • until

    Correct Answer
    A. for
    Explanation
    The missing keyword in this shell script example is "for". It is used to create a loop that will iterate a specific number of times, based on a given condition or range of values. The "for" loop is commonly used when you know the exact number of iterations you want to perform.

    Rate this question:

  • 20. 

    Qual dos seguintes arquivos, quando existentes, afetam o comportamento do shell Bash ? (Escolha duas respostas corretas.)

    • ~/.bashconf

    • ~/.bashrc

    • ~/.bashdefaults

    • ~/.bash_etc

    • ~/.bash_profile

    Correct Answer(s)
    A. ~/.bashrc
    A. ~/.bash_profile
    Explanation
    The correct answer is ~/.bashrc and ~/.bash_profile. These two files affect the behavior of the Bash shell. The ~/.bashrc file contains the individual user configurations for the Bash shell, such as aliases, functions, and settings. It is executed for each new interactive shell session. On the other hand, the ~/.bash_profile file is executed only for login shells and is commonly used to set environment variables and execute commands that should be run once when the user logs in.

    Rate this question:

  • 21. 

    Quando nós logamos em um sistema linux, o shell bash é iniciado com um shell de login. Este shell procura por quatro arquivos de inicialização para processar seus comandos na seguinte orden:

    • /etc/profile --> ~/.bash_profile --> ~/.bash_login --> ~/.profile

    • ~/.profile --> /etc/profile ~/.bash_login --> ~/.bash_logout

    • ~/etc/profile --> ~/.bash_login --> ~/.bash_profile --> ~/.bash_logout

    • ~/etc/profile --> ~/.bashrc --> ~/.bash_login --> ~/.bash_logout

    Correct Answer
    A. /etc/profile --> ~/.bash_profile --> ~/.bash_login --> ~/.profile
    Explanation
    When we log in to a Linux system, the bash shell is started with a login shell. This shell looks for four initialization files to process its commands in the following order: /etc/profile, ~/.bash_profile, ~/.bash_login, and ~/.profile. The answer provided lists the correct order of these files for the shell to process.

    Rate this question:

  • 22. 

    Os colchetes “[ ]” utilizados após o comando if, poderiam ser substituídos pelo comando _______.

    Correct Answer
    test
    Explanation
    The brackets "[ ]" used after the if statement can be replaced by the command "test". This means that the condition being tested in the if statement is being evaluated using the "test" command.

    Rate this question:

  • 23. 

    Quando o comando "echo $?" retorna a saída igual a 1, qual das seguintes afirmações é verdadeira ?

    • É o ID do processo do comando echo.

    • É o ID do processo do shell atual.

    • É o valor de saída do comando executado imediatamente antes do echo.

    • É o valor de saída do comando de echo.

    Correct Answer
    A. É o valor de saída do comando executado imediatamente antes do echo.
    Explanation
    When the command "echo $?" returns an output equal to 1, it indicates that the command executed immediately before the echo command had an exit status of 1. The exit status is a value returned by a command to the shell, indicating whether the command executed successfully or encountered an error. Therefore, in this case, the correct answer is that it is the exit value of the command executed immediately before the echo command.

    Rate this question:

  • 24. 

    A saída do comando 'seq 0 7 30' é:

    • 0 8 15 22 29

    • 1 7 8 15 22 29

    • 0 6 13 20 27

    • 0 7 14 21 28

    Correct Answer
    A. 0 7 14 21 28
  • 25. 

    Qual dos comandos abaixo pode ser utilizado em uma instrução SQL para combinar um resultado entre duas tabelas distintas através de um relacionamento existente entre elas?

    • JOIN

    • GROUP BY

    • SELECT

    • WHERE

    • UNION

    Correct Answer
    A. JOIN
    Explanation
    JOIN is the correct answer because it is the command used in SQL to combine the result of a query from two different tables based on a common relationship between them. It allows for the retrieval of data from multiple tables in a single query by matching rows with the same values in specified columns. This helps in creating a connection between related data and obtaining a comprehensive result set.

    Rate this question:

  • 26. 

    Um usuário reclamou que programas iniciados a partir de HOME não define a utilização de seu editor de texto favorito. Qual dos seguintes arquivos você deve editar para alterar isso?

    • .bash_rc

    • ~/bash.conf

    • .bashrc

    • .editor

    Correct Answer
    A. .bashrc
    Explanation
    The correct answer is ".bashrc". This file is a script that is executed whenever a new interactive shell is started. By editing this file, the user can customize their shell environment, including setting the default editor for programs started from the home directory.

    Rate this question:

  • 27. 

    Observe o script abaixo e assinale a alternativa que irá apresentar uma saída similar a do script.

    • ls -l *mp3

    • mv *.mp3 *.txt

    • ls *.mp3

    • mv *.mp3; echo all

    • cp *.mp3 *.txt

    Correct Answer
    A. ls *.mp3
    Explanation
    The correct answer is "ls *.mp3" because this command will list all files in the current directory that have the .mp3 extension, which is the same output as the given script.

    Rate this question:

  • 28. 

    Supondo que você criou uma tabela chamada "Clientes" e depois de um certo tempo decidiu alterar o nome desta tabela para "Meus_Clientes", qual instrução SQL iria realizar esta tarefa?

    • rename table Clientes to Meus_Clientes;

    • rename table Clientes for Meus_Clientes;

    • rename table Clientes from Meus_Clientes;

    • rename Clientes to Meus_Clientes;

    Correct Answer
    A. rename table Clientes to Meus_Clientes;
    Explanation
    To rename a table in SQL, the correct syntax is "rename table Clientes to Meus_Clientes;". This statement will change the name of the table "Clientes" to "Meus_Clientes".

    Rate this question:

  • 29. 

    A instrução ________ executa um ação em loop até que uma afirmação não seja mais verdadeira.

    • for

    • case

    • elif

    • until

    • while

    Correct Answer
    A. while
    Explanation
    The given question is asking for the instruction that executes an action in a loop until a condition is no longer true. The correct answer is "while" because the "while" loop continues to execute the code block as long as the specified condition is true. Once the condition becomes false, the loop stops executing.

    Rate this question:

  • 30. 

    Qual das seguintes alternativas são operadores usados ​​para comparações pelo comando teste? (Escolha duas correta respostas).

    • equals

    • =

    • -is

    • -eq

    • null

    Correct Answer(s)
    A. =
    A. -eq
    Explanation
    The correct answer is = and -eq. These are operators used in the test command for comparisons. The = operator is used for string comparisons, while the -eq operator is used for numeric comparisons.

    Rate this question:

  • 31. 

    De acordo com o diagrama ER abaixo, Assinale a alternativa correta. Qual das alternativas abaixo irá retornar a quantidade de registros na tabela tbl_Livro?

    • select * from tbl_Livro;

    • select count(*) from tbl_Livro;

    • select max(*) from tbl_Livro;

    • select avg(*) from tbl_Livro;

    Correct Answer
    A. select count(*) from tbl_Livro;
    Explanation
    A opção correta é "select count(*) from tbl_Livro;". Essa consulta irá retornar a quantidade de registros na tabela "tbl_Livro". O comando "count(*)" conta o número de linhas na tabela. As outras opções não retornarão a quantidade de registros, mas sim outros tipos de informações, como todos os registros da tabela ("select * from tbl_Livro;"), o valor máximo de uma coluna ("select max(*) from tbl_Livro;") e a média de uma coluna ("select avg(*) from tbl_Livro;").

    Rate this question:

  • 32. 

    Qual dos seguintes é a melhor maneira para listar todas as variáveis de shell definidas?

    • env

    • env -a

    • echo $ENV

    • set

    Correct Answer
    A. set
    Explanation
    The "set" command is the best way to list all the shell variables defined. It displays all the variables, including environment variables, local variables, and shell functions. The "env" command lists only the environment variables, while "env -a" lists all variables, including environment variables and shell variables, but it is not the best option as it includes unnecessary information. The "echo $ENV" command only displays the value of the "ENV" environment variable, not all variables.

    Rate this question:

  • 33. 

    Qual será o resultado produzido pelo seguinte comando: "seq 1 5 20" ?

    • 1 6 1 1 1 6

    • 1 5 10 15

    • 1 2 3 4

    • 2 3 4 5

    • 5 10 15 20

    Correct Answer
    A. 1 6 1 1 1 6
  • 34. 

    Bash, o shell padrão, usa o script de inicialização _________ para shells "interativos", e o _________ para shells de "login".

    • /etc/profile e /etc/bash.bashrc

    • /etc/bash.bashrc e /etc/profile

    • /etc/profile e ~/.bash_login

    • N.D.A

    Correct Answer
    A. /etc/bash.bashrc e /etc/profile
    Explanation
    The correct answer is "/etc/bash.bashrc e /etc/profile". In Bash, the "/etc/bash.bashrc" file is used for "interactive" shells, while the "/etc/profile" file is used for "login" shells. These files contain initialization scripts that are executed when a shell is started, providing settings and configurations for the shell environment.

    Rate this question:

  • 35. 

    Estou criando um shell script e necessito redirecionar a saída de um comando à uma variável. Qual das alternativas é verdadeira para realizar tal procedimento?

    • O comando deve está entre chaves. Ex: PROCESSOS_ATUAIS={ps aux}

    • O comando deve está entre colchetes. Ex: PROCESSOS_ATUAIS=[ps aux]

    • O comando deve está entre aspas simples. Ex: PROCESSOS_ATUAIS='ps aux'

    • O comando deve está entre crases. Ex: PROCESSOS_ATUAIS=`ps aux`

    • N.D.A

    Correct Answer
    A. O comando deve está entre crases. Ex: PROCESSOS_ATUAIS=`ps aux`
    Explanation
    The correct answer is "O comando deve está entre crases. Ex: PROCESSOS_ATUAIS=`ps aux`". This is because using backticks or crases around a command in shell scripting allows the output of that command to be assigned to a variable. In this case, the command "ps aux" will be executed and the output will be stored in the variable PROCESSOS_ATUAIS.

    Rate this question:

  • 36. 

    Depois de emitir: "function myfunction { echo $1 $2; }" em seu bash. A saída no stdout ao executar: "myfunction A B C" será:

    • A B

    • A B C

    • A C

    • B C

    • C B A

    Correct Answer
    A. A B
    Explanation
    After defining the function "myfunction { echo $1 $2; }" in the bash, the output on stdout when executing "myfunction A B C" will be "A B". This is because the function is defined to only echo the first two arguments passed to it, which in this case are "A" and "B". The third argument "C" is not included in the output.

    Rate this question:

  • 37. 

    Analise o comando abaixo e marque a opção correta:

    • Podemos afirmar que a tabela clientes possui apenas os campos id, nome, cpf e data_nasc.

    • Podemos afirmar que a ordem dos campos na tabela clientes é exatamente como está apresentada no comando acima.

    • A ordem dos campos não é importante ao realizar uma inserção na tabela, no entanto que a ordem dos valores seja a mesma que a ordem dos campos.

    • A ordem dos valores e a ordem dos campos não precisam estar relacionados.

    Correct Answer
    A. A ordem dos campos não é importante ao realizar uma inserção na tabela, no entanto que a ordem dos valores seja a mesma que a ordem dos campos.
    Explanation
    The correct answer states that the order of the fields is not important when inserting data into the table, as long as the order of the values matches the order of the fields. This means that when inserting data, the values must be provided in the same order as the fields in the table, but the fields themselves can be in any order.

    Rate this question:

  • 38. 

    Qual dos comandos a seguir permite que o usuário smith seja removido quando do uso da linguagem SQL padrão?

    • drop user smith

    • delete user smith

    • cancel user smith

    • remove user smith

    Correct Answer
    A. drop user smith
    Explanation
    The correct answer is "drop user smith". In SQL, the "drop user" command is used to remove a user from the database. By specifying the username "smith" after the command, it indicates that the user named "smith" should be removed. The other options ("delete user smith", "cancel user smith", and "remove user smith") are not valid SQL commands for removing a user.

    Rate this question:

  • 39. 

    Qual dos seguintes comandos atribui a saída do comando date à variável shell chamada mydate?

    • mydate="$(date)"

    • mydate="exec date"

    • mydate="$((date))"

    • mydate="date"

    • mydate="${date}"

    Correct Answer
    A. mydate="$(date)"
    Explanation
    The correct answer is mydate="$(date)". This command assigns the output of the "date" command to the shell variable called "mydate". The "$()" syntax is used to capture the output of a command and assign it to a variable.

    Rate this question:

  • 40. 

    Qual dos seguintes comandos cria uma função Bash que gera a soma de dois números?

    • function sumitup { echo $(($1 + $2)) ; }

    • command sumitup { echo $(($1 + $2)) ; }

    • function sumitup { echo $1 + $2 ; }

    • method sumitup { echo $1 + $2 ; }

    • command sumitup { echo $1 + $2 ; }

    Correct Answer
    A. function sumitup { echo $(($1 + $2)) ; }
    Explanation
    The correct answer is "function sumitup { echo $(($1 + $2)) ; }". This is the correct command to create a Bash function that generates the sum of two numbers. The function is named "sumitup" and it uses the echo command to output the result of the addition of the two input numbers, which are represented by $1 and $2. The $(()) syntax is used to perform the arithmetic addition operation.

    Rate this question:

  • 41. 

    Os usuários geralmente querem configurar seu login e shell interativo de maneira similar. Para fazer isso, eles escolhem interpretar (ou “fonte”) o contéudo de ~/.bashrc no arquivo ~/.bash_profile. É possível fazer a mesma coisa com arquivos comuns a todos os usuários (referenciando _________ a partir de _________).

    • A afirmativa está equivocada.

    • /etc/profile a partir de ~/.bashrc

    • /etc/bash.bashrc a partir de /etc/profile

    • N.D.A

    Correct Answer
    A. /etc/bash.bashrc a partir de /etc/profile
    Explanation
    Os usuários geralmente querem configurar seu login e shell interativo de maneira similar. Para fazer isso, eles escolhem interpretar (ou "fonte") o conteúdo de ~/.bashrc no arquivo ~/.bash_profile. É possível fazer a mesma coisa com arquivos comuns a todos os usuários referenciando /etc/bash.bashrc a partir de /etc/profile.

    Rate this question:

  • 42. 

    Estou escrevendo um shell script onde necessito realizar uma operação matemática e atribuir seu resultado à uma variável. Qual das alternativas corresponde a sintaxe correta desta tarefa? (Selecione 2 respostas).

    • RESULT=$[2+6]

    • RESULT=&[2+6]

    • RESULT=$((2+6))

    • RESULT=${2+6}

    Correct Answer(s)
    A. RESULT=$[2+6]
    A. RESULT=$((2+6))
    Explanation
    The correct answer is "RESULT=$[2+6], RESULT=$((2+6))". The first option "RESULT=$[2+6]" uses the square brackets syntax to perform the mathematical operation and assign the result to the variable RESULT. The second option "RESULT=$((2+6))" uses double parentheses to perform the mathematical operation and assign the result to the variable RESULT.

    Rate this question:

  • 43. 

    Para testar um script em shell chamado meuscript, a variável de ambiente FOOBAR deve ser removida temporariamente. Como isto pode ser feito?

    • unset -v FOOBAR

    • env -i FOOBAR meuscript

    • set -a FOOBAR=""

    • env -u FOOBAR meuscript

    Correct Answer
    A. env -u FOOBAR meuscript
    Explanation
    To temporarily remove the environment variable FOOBAR in order to test a shell script called meuscript, the command "env -u FOOBAR meuscript" can be used. This command unsets the value of the FOOBAR variable for the duration of executing the meuscript script.

    Rate this question:

  • 44. 

    Você deseja executar o comando ls, mas parece ser alias. Qual é a maneira mais fácil de executar o ls original ?

    Correct Answer
    \ls
    Explanation
    The given answer suggests using the backslash (\) before the command "ls" to execute the original version of the command. In this case, the backslash will bypass any alias that may have been set for the "ls" command and directly execute the original command.

    Rate this question:

  • 45. 

    Qual das alternativas abaixo contén operadores lógicos utilizados em SQL?

    • AND, OR e NOT

    • &&, | e !

    • AND, OR e AND NOT

    • N.D.A

    Correct Answer
    A. AND, OR e AND NOT
    Explanation
    The correct answer is "AND, OR e AND NOT". In SQL, the logical operators "AND" and "OR" are used to combine multiple conditions in a query, while "AND NOT" is used to exclude certain conditions from the result set. The other options listed do not contain valid SQL logical operators.

    Rate this question:

  • 46. 

    Que saída produzirá a seguinte sequência de comandos? echo '1 2 3 4 5 6' | while read a b c ; do echo resultado: $c $b $a; done

    • resultado: 6 5 4 3 2 1

    • resultado: 3 4 5 6 2 1

    • resultado: 1 2 3 4 5 6

    • resultado: 6 5 4

    • resultado: 3 2 1

    Correct Answer
    A. resultado: 3 4 5 6 2 1
    Explanation
    The given command "echo '1 2 3 4 5 6' | while read a b c ; do echo resultado: $c $b $a; done" reads the input "1 2 3 4 5 6" and assigns the values to variables a, b, and c. Then, it echoes the result in the format "resultado: $c $b $a". So, the output will be "resultado: 3 4 5 6 2 1".

    Rate this question:

  • 47. 

    Qual palavra está faltando a seguinte instrução SQL? insert into tablename ________(909, 'text');

    Correct Answer
    values
  • 48. 

    A instrução ________ executa um ação em loop até que uma afirmação seja verdadeira.

    • for

    • case

    • elif

    • until

    • while

    Correct Answer
    A. until
    Explanation
    The instruction "until" executes an action in a loop until a certain condition becomes true.

    Rate this question:

  • 49. 

    Qual palavra está faltando a seguinte instrução SQL? update tablename ____ fieldname='value' where id=909; (Por favor, especifique a palavra que falta utilizando apenas letras minúsculas).

    Correct Answer
    set
    Explanation
    The missing word in the given SQL instruction is "set". In an SQL update statement, the "set" keyword is used to specify which column or field should be updated with a new value. In this case, the missing word "set" indicates that the "fieldname" should be updated with the value 'value' where the id is equal to 909.

    Rate this question:

Quiz Review Timeline (Updated): Jul 22, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jul 22, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • May 23, 2017
    Quiz Created by
    Viniciusalcantar
Back to Top Back to top
Advertisement