answersLogoWhite

0


Best Answer

No, the shell needs both execute and read permissions to run the script.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you execute a shell script if you do not have read permission for the file containing the script?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the two ways you can execute a shell script when you do not have execute access permission for the file containing the script?

To do this you will need at least read permission; if you don't have that then you will not be able to execute the script at all. One way is to copy the script to your directory and add the execute permission. The second way is to call the correct shell interpreter program directly, as in: ksh /some/file/shell


What is the command to execute a shell script?

If the shell script is readable and executable then to execute it just type the name of the shell script file. Otherwise, you can explicity call a shell interpreter to run the file as a shell script, i.e., ksh myfile


How do you execute shell script under Linux?

Eithersh shellscript.shor./shellscript.sh


How do you compile and run shell script of factorial?

Shell scripts are not compiled; they are interpreted (and therefore do not need to be compiled). Just type in the name of the shell script and any parameters it needs to execute.


What is the procedure of execute a script in shell in ubantu?

For any Unix or Linux based operating system, make the text file readable and executable and then invoke (call) it by the file name, which will execute the script.


How do you write shell scripting in UNIX?

A shell script is nothing more than a readable and executable ASCII text file. In this file you put all of the commands that you want to execute, in sequence. The name of the file can be anything you like. Any text editor (VI, VIM, pico, etc) can create a shell script file In addition, shell script files have the ability to detect logic, and are programmable. Just think about what tasks you want to perform and their order, and put it into a file, and there you have a shell script.


Which command in unix is used to run the script immediately?

As long as the script file is readable and executable, just type the name of the script and it will execute immediately. Otherwise, you can call the shell interpreter and have it run it immediately such as: bash ./thefile where ./thefile is the script you want to run. Or, substitute the shell interpreter you wish to use instead of bash, such as sh, ksh, tcsh, csh, etc.


What is a command in Unix?

Essentially, a command in Unix is a program that you execute for a certain purpose. It could be anything, from a shell script, to copying or deleting files, etc.


How do you create a shell in unix?

If you are asking about a shell script, just create a text file with the commands you want to execute inside it. Then, make the file executable and readable and you have a shell script file. A shell program is more complicated; you need to support the user features that most users would expect a shell program or shell interpreter to do. I would suggest studying the source code of a current shell program to see how to go about implementing one of your own.


Write a shell script which deletes all line containing the word unix in the filesn suppiled as argument to this shell script?

# SS29 # Script to delete all lines containing the word 'unix' from files supplied as arguments # Usage: SS29 file1 file2 file3 ... if [$# -lt 2] then echo Insufficient arguments exit fi for file do grep -v unix $file>/temp/$file cp /temp/$file $file done


How do you execute shell program in unix?

Make sure it is readable and executable (permissions). Then, just type in the name of the shell file to execute it.


Write a shell script to show that user is logged in or not?

You don't need a shell script for that; use either 'whoami' or 'id'