DevOps

Shell Scripting & Bash

Variables, loops, conditionals, functions, pipes, redirections

20 питань зі співбесід·
Mid-Level
1

What is the correct syntax to declare a variable in Bash?

Відповідь

In Bash, a variable is declared without the dollar sign and without spaces around the equals sign. The variable name must start with a letter or underscore. To use the variable's value, prefix its name with the dollar sign ($). Spaces around the equals sign cause a syntax error because Bash interprets them as separate command arguments.

2

How to access the value of a variable named USERNAME in Bash?

Відповідь

To access a variable's value, prefix its name with the dollar sign ($). The syntax $USERNAME retrieves the value stored in the variable. The syntax ${USERNAME} can also be used, which offers more flexibility, especially for concatenation or using modifiers. Without the dollar sign, Bash interprets USERNAME as a literal string and not as a variable reference.

3

Which command allows exporting a variable to make it accessible to child processes?

Відповідь

The export command makes an environment variable available to all child processes launched from the current shell. Without export, a variable is local to the current shell and is not passed to subprocesses. This distinction is crucial when writing scripts that invoke other scripts or programs. It is possible to combine declaration and export in one line with export VAR=value.

4

How to capture the exit code of the last executed command?

5

What is the correct syntax for an if condition in Bash?

+17 питань зі співбесід

Інші теми співбесід DevOps

Version Control & Git

Junior
20 запитань

Linux Fundamentals

Junior
22 запитань

Networking Basics

Junior
22 запитань

Docker Fundamentals

Junior
24 запитань

CI/CD Fundamentals

Junior
18 запитань

GitHub Actions

Mid-Level
22 запитань

GitLab CI/CD

Mid-Level
22 запитань

Jenkins

Mid-Level
22 запитань

Kubernetes Basics

Mid-Level
26 запитань

Kubernetes Networking

Mid-Level
24 запитань

Kubernetes Advanced

Mid-Level
24 запитань

Ingress & API Gateway

Mid-Level
20 запитань

Terraform Basics

Mid-Level
22 запитань

Terraform Advanced

Mid-Level
22 запитань

Ansible & Configuration Management

Mid-Level
20 запитань

AWS Essentials

Mid-Level
26 запитань

Azure Fundamentals

Mid-Level
22 запитань

GCP Fundamentals

Mid-Level
22 запитань

Monitoring & Prometheus

Mid-Level
22 запитань

Logging & ELK Stack

Mid-Level
20 запитань

Alerting & Incident Response

Mid-Level
20 запитань

Cloud Identity & Secrets

Mid-Level
22 запитань

CI/CD Pipeline Security

Mid-Level
20 запитань

Helm & Kubernetes

Mid-Level
20 запитань

Runtime & Cluster Security

Senior
24 запитань

Container Supply Chain Security

Senior
22 запитань

Service Mesh & Istio

Senior
24 запитань

GitOps & ArgoCD

Senior
22 запитань

Progressive Delivery

Senior
20 запитань

Distributed Observability

Senior
22 запитань

Disaster Recovery & Backup

Senior
20 запитань

Performance Optimization

Senior
22 запитань

Cloud Cost Optimization

Senior
20 запитань

SRE Principles

Senior
24 запитань

Chaos Engineering

Senior
20 запитань

Platform Engineering

Senior
22 запитань

Опануй DevOps для наступної співбесіди

Отримай доступ до всіх питань, flashcards, технічних тестів, вправ code review та симуляторів співбесід.

Почни безкоштовно