Bash Scripting Interview Questions

Поделиться
HTML-код
  • Опубликовано: 5 окт 2019
  • Bash shell script is a computer program written in the Bash programming language. Shell scripting is the art of creating and maintaining such scripts. It has demand and when you go to interview, you could be asked a few questions that you might find tricky, we have tried to solve this problem by answering the most important questions in advance so you go in well prepared.
    These are the most important 30 bash questions that you could be asked during an interview:
    1-What is bash script? (00:00:43)
    2-What are the advantages of using bash scripts? (00:01:28)
    3-Mention the disadvantages of bash scripts? (00:02:22)
    4-What types of variables are used in bash? (00:03:09)
    5-How to declare and delete variables in bash? (00:07:39)
    6-How to add comments in a bash script? (00:11:43)
    7-How can you combine strings in a bash script? (00:12:46)
    8-Which commands are used to print output in bash? (00:14:43)
    9-How to take input from the terminal in bash? (00:16:42)
    10-How to use command-line arguments in bash? (00:17:58)
    11-Is bash a weakly typed language? Why? (00:21:25)
    12-How to read the second word or column from each line of a file? (00:24:53)
    13-How to declare and access an array variable in bash? (00:27:51)
    14-How can conditional statements be used in bash? (00:33:40)
    15-How to compare values in bash? (00:36:47)
    16-Which conditional statement can be used as an alternative to if-elseif-else statements in bash?(00:38:24)
    17-What different types of loops can be used in bash? (00:42:00)
    18-How can subroutines be declared and called in bash? (00:47:35)
    19-How to cut and print some part of a string data in bash? (00:51:57)
    20-Mention some ways to perform arithmetic operations in bash? (00:54:56)
    21-How to check a directory exists or not using bash? (00:57:29)
    22-How can a bash script be terminated without executing all statements? (01:00:29)
    23-What are the uses of break and continue statements in bash? (01:01:37)
    24-How to make a bash file executable? (01:06:52)
    25-Mention some options that are used to test files (01:09:17)
    26-What is meant by ‘bc’ and how can this command can be used in bash? (01:11:24)
    27-How can you print a particular line of a file in bash? (01:13:39)
    28-What is IFS? (01:15:19)
    29-How to find out the length of a string data? (01:17:37)
    30-How to run multiple bash script in parallel? (01:20:29)
    We have tried to answer each question briefly and in detail and have explained questions with well written bash code examples. You can also read our article on this topic on our website:
    linuxhint.com/bash_scripting_...
    Chmod File Permissions Explained:
    • 9 File Permissions
  • НаукаНаука

Комментарии • 15

  • @kkyes
    @kkyes 3 года назад +3

    good refresher before going to interviews..

  • @bujinmasha6968
    @bujinmasha6968 3 года назад +1

    Thank you so much! You are simple the best. Your explanation is clear with point.

  • @kkyes
    @kkyes 3 года назад +4

    while loop without the confusion of double brackets ..
    declare -i n=6
    while [ $n -gt 0 ]
    do
    declare -i sqr=n*n
    echo $sqr
    n=n-1
    done
    I read about double parenthesis.. good to handle arithmetic calculations .. thanks

  • @MGtvMusic
    @MGtvMusic 3 года назад

    Thank you Enjoyed learning/revising from the video

  • @shivaniarora9294
    @shivaniarora9294 3 года назад

    keep sharing the knowledge ...!!! You did well !!!

  • @bujinmasha6968
    @bujinmasha6968 3 года назад

    The best Tutorial.

  • @vasucherry4501
    @vasucherry4501 4 года назад +2

    Sir its awesome :)

  • @nehupiyu
    @nehupiyu 2 года назад

    Just perfect!!

  • @chrismbah597
    @chrismbah597 8 месяцев назад

    Nice questions

  • @_Slin
    @_Slin 2 года назад

    I dont know about multiple string comment as
    : '
    bla bla
    bla bla
    '
    Thanks for sharing! I will see full video. Maybe I will find something else for learn.

  • @prathamdone1881
    @prathamdone1881 Год назад

    read -p "enter number: " n
    if [ $n -gt 100 ]; then
    echo "$n is greater than 100"
    elif [ $n -gt 50 ]; then
    echo "$n is greater than 50"
    else
    echo "$n is less than 50"
    fi
    This is the correct Program at video 36:41

  • @nishantjasra5291
    @nishantjasra5291 2 года назад

    51:49:00 bro you didn't even assign any z variable outside the function, so it will only print and assume that z from inside the function, and will give answer for inside function, so why would it print anything outside when it is not assigned

  • @bostonboy6177
    @bostonboy6177 2 месяца назад

    Why can I see anything in the more... fields