whta is the use of "exec" command?

Answer Posted / ashu

The exec command will execute a command in place of the
current shell; that is, it terminates the current shell and
starts a new process in its place.

Use of exec command:

exec is oftenly used to execute the last command of a shell
script. This would kill the shell slightly earlier;
otherwise, the shell would wait until the last command was
finished. This practice saved a process and some memory.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of commonly used shells on a typical linux system?

764


How to replace following lines, catch (DAOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } catch (BOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw e; } catch (Exception e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } Needs to be changed in to, catch (DAOException e) { AppException.handleException (null, null, e, null, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); } catch (BOException e) { AppException.handleException (null, null, null, e, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 0); } catch (Exception e) { AppException.handleException (null, null, null, null, null, e, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); }

2147


What is the way to do multilevel if-else's in shell scripting?

968


What is the difference between grep and egrep?

841


I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

977


How to print all the arguments provided to the script?

773


What is echo $shell?

824


What is batch file programming?

912


What are the different communication commands available in the shell?

726


What does path stand for?

833


Explain about echo command?

858


What is an sh file?

745


What is c in shell script?

817


What is the first line of a shell script called?

805


How do I run a powershell script?

800