Shell Scripting Interview Questions & Answers | Linux Admin Certification Training | Edureka

Поділитися
Вставка
  • Опубліковано 28 жов 2024

КОМЕНТАРІ • 17

  • @edurekaIN
    @edurekaIN  5 років тому +5

    Got a question on the topic? Please share it in the comment section below and our experts will answer it for you. For Edureka Linux Training and Certification Curriculum, Visit the website: bit.ly/2CzTN8u

  • @SudeshKumarPujari
    @SudeshKumarPujari 4 роки тому +8

    That made my life way better dealing with Shell scripts.. Thanks so much

  • @karthikprabhu9248
    @karthikprabhu9248 4 роки тому +2

    tnk u team edureka.. u guyz are more helpful to me

  • @ankanmazumdar5000
    @ankanmazumdar5000 4 роки тому +2

    Hi Edureka & Upasana ,
    For #47, could you please give some examples for inserting debugging statements in a script.

    • @edurekaIN
      @edurekaIN  4 роки тому +6

      Hi Ankan, run a shell script with -x option.
      $ bash -x script-name
      $ bash -x script.sh
      Hope that helps!

  • @mfaraday4044
    @mfaraday4044 5 років тому +1

    best technical channel for beginner

  • @prasadrayudu2001
    @prasadrayudu2001 4 роки тому

    Excellent lecture - Thanks for this video.

  • @indrajeet5000
    @indrajeet5000 5 років тому +2

    Thanks for this.

  • @sreekanthadari1
    @sreekanthadari1 3 роки тому

    Thank you so much, i enjoyed learning sh

    • @edurekaIN
      @edurekaIN  3 роки тому

      Many thanks! Glad you liked it ! We are glad to have learners like you . Do subscribe our channel and hit that bell icon to never miss an video from our channel .

  • @225sudheer
    @225sudheer 5 років тому +1

    Please explain exception handling in shell script

    • @edurekaIN
      @edurekaIN  5 років тому +4

      Hi Sudheer, There isn't any sort of try/catch in bash (i assume you're using bash), but you can achieve a quite similar behaviour using && or ||.
      In this example, you want to run fallback_command if a_command fails (returns a non-zero value):
      a_command || fallback_command
      And in this example, you want to execute second_command if a_command is successful (returns 0):
      a_command && second_command
      They can easily be mixed together by using a subshell, for example, the following command will execute a_command, if it succeeds it will then run other_command, but if a_command or other_command fails, fallback_command will be executed:
      (a_command && other_command) || fallback_command

  • @divyamoilla6467
    @divyamoilla6467 2 роки тому +3

    Can we run the .sh file without the bang line(#!/bin/sh) ?

  • @adrianharo6586
    @adrianharo6586 3 роки тому +1

    thank youu!

  • @syamkumar7751
    @syamkumar7751 4 роки тому

    Nicely explained

  • @chiju5
    @chiju5 5 років тому +1

    for question 11, it is not 'cat $1', it should be 'echo $0'

    • @edurekaIN
      @edurekaIN  5 років тому +2

      Hi Chiju, $0 would extend to the name of the shell script, which is not the purpose of the question.