How someone can execute my unix file after giving permission? [closed] - perl

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have already given permission to execute my perl file to group and others(using chmod 711) but what command line I should give them to execute my file.
can someone please help me with this.?
Thank you.

When someone start such a file, it will actually be read by the perl interpreter program, which means that it must allow read access as well.
Suppose your file is called 'myfile.pl', you can then always start it with
perl /path/to/myfile.pl
In that case you start the perl interpreter and tell it to read commands from your file.
If your file is readable and executable, and starts with a line like
#!/usr/bin/perl
or
#!/usr/bin/env perl
then you can start it with
/path/to/myfile.pl
which, in case the file is in the current directory can be as short as
./myfile.pl

Related

gvim 8.2 doesn't paste on windows 10 in powershell [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I installed vim on Windows 10 with chocolatey. Copy and Paste don't work when I invoke vim in powershell. I expect them to work as long as I'm in insert mode. How can I make copy and paste work?
https://n3wjack.net/2014/08/25/setting-up-vim-on-windows/ has the answers.
Open vim and type the following:
:edit $MYVIMRC
This will edit your .vimrc file wherever it might live. (On my system, it was in c:\Users\<my_username>\.vimrc, but you might have weird configuration issues, so just let vim find the file for you.
Then, copy+paste the following into the file:
source $VIMRUNTIME/mswin.vim
behave mswin
Then save the file.

How can i make my custom command available to all user in linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I have written a custom command under user 'krishna' on my laptop, and now i want it to be available for other all user without redefining to each user. For now, i have defined the command in /home/krishna/.bashrc As this file exist under user krishna and work only for krishna. is there any way i can defile it globally for all users?
You can define the command in the /etc/bashrc or /etc/bash.bashrc file (which one depends on your distribution). One of these should exist on your machine.
Commands you define in your local /home/[USER]/.bashrc are only available for [USER].
Commands or aliase defined in /etc/bashrc are available for all useres

What is the use of perl folder in xampp why it is included in xampp? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
As we know that xampp is for web development but what is the use of perl folder in xampp? Why perl folder is included in xampp? I am beginner and have no idea about the perl folder but i know perl is a programming language.
Can anyone tell?
XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use.
— https://www.apachefriends.org/index.html
The Perl folder contains files needed to run server-side code written in Perl.

Is there any reason a System V init script has to be written in bash? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
Is it possible to write a System V init script (the scripts usually stored in /etc/init.d and run with service) in Perl, and have the shell recognize the #!/usr/bin/perl? Would there be any downside to doing this?
The scripts themselves can be written in any language, but support tools may need to parse the script for metadata required to decide when the initscript will start/stop. This restricts the choices to those which can make this metadata available in the form that the tools accept.
Additionally, there may be external files written in shell script which the initscript will require in order to operate properly/efficiently/effectively. Unless these files are very simple, any parser used to read them may grow very complex.

Perl: Changing the name of files [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
Everyday the following files appear in my computer (one per day, inside /my/dir/):
stackoverflow.20130712_0.log
stackoverflow.20130713_0.log
I want to change their name to stackoverflow.20130712 and stackoverflow.20130713, that is, erase the "_0.log" part everyday with a cron job.
A module or script you would recommend me?
I'm on CentOS
You can get the rename script from CPAN:
http://search.cpan.org/perldoc?rename
Then you can do:
rename 's/_0.log$//' stackoverflow*_0.log
No dependencies solution,
perl -e 'for (#ARGV){ $t=$_; s|_0[.]log$||; rename($t,$_) }' stackoverflow.*