answersLogoWhite

0


Best Answer

A shell function will do nothing unless it is explicitly called by other code, typically in a shell script. A shell script is a runnable, executable process, which can call other shell scripts and/or functions.

The question might be worded backwards - it is necessary to write shell functions for shell scripts when certain logical functionality is required to be performed multiple times. Consider a shell function equivalent to a program subroutine - they operate the same way.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: When might it be necessary or advisable to write a shell script instead of a shell function?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a code in java script for follow the image with cursor?

<html> <head> <script language="javascript"> function f_follow(event) { temp.style.position="absolute";//this is necessary temp.style.left=event.clientX; temp.style.top=event.clientY; } </script> <body onmousemove="f_do(event)"> <img src="....." id="temp"/> </body> </html>


What are some scripts for script builder?

I have no idea what language you mean in anyway. But Ill answer it in TorqueScript. Since it's just my favorite First you need to make something that will read the premade script function makeScript(%script) { %file = new fileObject(); %file.openForWrite($WhereEver); %file.writeLine(%script); %file.close(); %file.delete(); } Thennn all you do is at the bottom do things like this: $Script[1] = "function serverCmdDoStuff() {}"; makeScript($Script[1]); etc. for a delete script function deleteScript(%script) { filedelete(%script); } And that's it.


How can you read from a script without the teacher noticing?

It is not advisable to read from a script without the teacher noticing as it may be considered cheating or dishonest. It is better to practice the material beforehand so that you can speak confidently and naturally without relying on a script.


What is a script file in Linux?

A script is a file that contains a set of commands to be performed. Instead of you manually entering all of the commands into the console, the script is run and does it automatically.


Where are scripts placed in an HTML document?

you can put your script into a function. A function contains code that will be executed by an event or by a call to the function.


What is the function die used for in PHP?

The function die() stops the script from running. See the example below: <?php die("this text will be outputted on the page"); echo "this text will not be shown due to the script ending when the die() function was called"; ?>


Script for walk through brick on roblox?

by: scripterV1O You don't need a script, but if you want a script instead of just unchecking CanCollide in the properties window do this... script.Parent.CanCollide = false Make sure the script is in the brick


How can you protect zip file with password with the help of UNIX script?

A Unix script is not necessary. The zip utility has the capability of compressing the files with a password.


Free pirates of penzance jr script?

Go on google instead


How do you use settime out in php?

we cant use set timeout function in php because it is of java script function


What job functions could you script in a UNIX or DOS shell script?

Actually, just about anything you want to do. Depends on the job function requirements.


What are 'script errors'?

Example. You are writing a play for school. The actual writing part is called the script, script errors are words that are spelled wrong, or scenes that don't follow and there-fore re-writes are necessary.