Home / Interview / Shell Script :: General Questions

Interview :: Shell Script

11) Is it possible to substitute "ls" command in the place of "echo" command?

Yes.

12) What is the syntax of while loop in shell scripting?

The while loop is used to repeat its block of commands a number of times. It is different from for loop, it iterates until the while condition is no longer true.

13) What is the difference between soft and hard links?

Inode: Each file contains an index number known as "inode" which is comprised of metadata about the associated file.

inode

Hard Link: is the mirror of original linked file. In such case, hard link and original file contains same inode. Hard link remains linked whether original file is removed.

inode 2

Soft Link: is like shortcut feature of Windows OS. In such case, hard link and original file contains different inode. Soft link will not work correctly if original file is removed.

inode 3
14) What is the use of "$#" in Shell Scripting?

The $# shows total number of arguments passed to the script.

15) What are the Zombie processes?

Zombie processes are the processes which are died but exit status is not picked by the parent process.

16) What are the 3 standard streams in Linux?

0 - Standard Input

1 - Standard Output

2 - Standard Error