Running a Perl script in Eclipse Classic in Linux Redhat - linux

I have a Perl script which I want to run in Linux. I know about the plugins which we can use, but that's a limitation for me. I will have to use External Tools Configurations to run it. I searched on the internet, but there is no place where i could find the explanation.
I tried using external tools, but when I run it nothing is showing up on my screen. May be I did the wrong way.
The way I filled it was:
Name: I gave any random name
Location: I gave /usr/bin/perl
Working Directory: the path of the directory where my Perl script is located.
Arguments: Name of my Perl script.
I would also like to mention that my script calls an executable file (a C++ makefile) which runs rest of my program. Maybe that is the problem?
I am using Perl perspective. I am not an Eclipse expert, so I might be missing something important. Please advise.

I think the location would be your Perl script.
/usr/bin/perl /path/to/your/script.pl
/path/to/your/script.pl
Check these links, maybe useful:
http://wiki.eclipse.org/FAQ_How_do_I_add_my_own_external_tools%3F
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-exttools-running.htm

Related

Solana Can't find devnet.json

I'm following this article as a practice.
And stuck with
cat .config/solana/devnet.json
I realize that windows OS doesn't have cat so I tried
type ~/.config/solana/devnet.json
that result in
The syntax of the command is incorrect.
so I try again with
type "~/.config/solana/devnet.json"
and this time, it leads to
The system cannot find the file specified.
It's kind of surprise me so I browse that directory(C:\Users\my-name\.config\solana) and found devnet.json is truly not there.
My questions are where could this file be? Or which step I might do wrong so the file was not generated? I check the result message of each step, things look fine...
It turns out since I didn't change the working directory so the devnet.json is saved in C:\Windows\System32\~\.config\solana
Got the same problem
It seems that there is no devnet.json file created but the devnet wallet works successfully
you may download git bash on your windows machine and can simply use cat and all bash commands after?
You're following Linux instructions which are not 100% compatible with your Windows OS. ~ is alias for home directory in Linux and it doesn't work in Windows where ~ is a normal char. That led to you the initial confusion. Also other differences like type / cat. On Windows use full path to your home directory (usually something like C:\Users..., etc.). So your key-gen command can look like something like this
solana-keygen new --outfile C:/Users/hsiao/keys/devnet.json
Then you can use
solana config --keypair C:/Users/hsiao/keys/devnet.json
and be happy ever after!

conditional hashpling in LINUX text scripts

As a workaround for a problem that I face when deploying code using central version control throughout various sites in the company I work, I need, in all sites, to run Ruby from (say):
#!/foo1/bin/ruby -w
However, in just 1 location, ude to an I.T. issue, which may or may not be resolved, I need to use (say):
#!/foo2/bin/ruby -w
This needs to work for ALL users in ALL sites, and I cannot enforce the setup of environment variables. One can of course, use a bash script to split the 2, (a bash script calling either of the locations), but I was hoping for just 1 process, and 1 script. Any ideas?
There are many options to solve that but the simples that I'm familair with is:
Make sure that ruby is accesible by the PATH environment variable.
Instad of using the full path to ruby you can use the /bin/env command that comes in all Linux bundles:
#!/bin/env ruby

Find out how or where a program (script) is automatically starting at ubuntu 14 boot?

Running Ubuntu 14.04, and I have a script that is being run automatically when I boot the machine. For the life of me, I can't remember how or where I did this.
I already checked:
upstart (which doesn't seem to be available here, anyway)
/etc/rc.local
crontab (with #reboot)
/etc/init
/etc/init.d
.config/autostart (doesn't exist btw)
It's a script of my own, so it's not some kind of malicious virus or malware or anything. I just can't remember how I did this, and would like to know.
It has a distinct name, e.g. like ~/MyScriptXYZ.sh so I could search for that, IF I know how or where..?? (I'm a novice linux user)
A few other places you can look:
crontab -e as your own user and as root (local user crontab)
/etc/profile.d/ or /etc/profile
~/.profile
~/.bashrc
The last ditch attempt you can do is to cd / && grep -R "MyScriptXYZ" as root - this will take a while but will search all files on your computer for that reference :)
So I stumbled across this question and I managed to solve it for myself:
I was using Ubuntu (chroot) through the Linux Deploy Android app and I also couldn't find it. So to make the answer complete: Use pstree to locate and trace what is currently running and see where it's originating from.
Following Basile Starynkevitch's advice I managed to solve it by going to:
/home/[user]/.config/lxsession/LXDE/autostart and find it the code I added a while ago.

Cygwin and PHP Executable

In Windows, using Cygwin: How can I get the shebang line in a shell file to load the PHP interpreter?
I am using the prggmr library.
By default, in the shell file this is what I have
#!/usr/bin/php
And it works if I type this into Cygwin:
php c:/path/to/file
I have PHP and this Library setup in my environment paths so I can just type prggmr. So by typing "prggmr" it should work, but i keep getting
/cygdrive/c/lib/prggmr/bin/prggmr: /cygdrive/c/wamp/bin/php/php5.4.3:
bad interpreter: Permission denied
I have tried these with no luck, the same error as above:
#!/c/wamp/bin/php/php5.4.3
#!/cygdrive/c/wamp/bin/php/php5.4.3
If I'm reading your Paths right you have a Win32 PHP installed that you want to use with PHP. Normally, I'd say don't do it this way as things are going to get confused. Better to install PHP in Cygwin directly imo. There are a few resources out there, check out
this one for a good starting point.

module: command not found

I'm attempting to load several modules for building a library on Linux but am told that the command 'module' doesn't exist. I've Googled around and discovered that the solution was to source a directory called "module" which I am unable to locate despite extensive searching.
I'm not quite sure what I should and any help would be appreciated (it might help to know that the makefile I'm working with uses csh while my default shell is bash). Thanks!
I tried to reproduce it and it turns out that for me sourcing
source /etc/profile.d/modules.sh
in th .sh script helps for bash and similar. For csh and tcsh, you have to add
source /etc/profile.d/modules.csh
to the script. Note, that this line must come first and then the
module load foo
line.
I got here as I was searching for ways to install multiple php versions in CentOS7 and https://blog.remirepo.net/post/2019/05/22/PHP-7.4-as-Software-Collection was one of the articles I tried to follow and encountered the same "module: command not found" issue.
Sourcing /etc/profile via command:
. /etc/profile
seems to make the "module load" work.
Credits to fadishei in https://forums.fedoraforum.org/showthread.php?262708-module-command-not-found
To make the version of php (e.g. php7.4) persist, append the following to file /etc/profile.d/custom.sh
source /etc/profile.d/modules.sh
module load php74
Reboot and run the php --version to cross-check that php 7.4 is the current version installed.
I think that you have to put this in your script to define the module command:
module () {
eval `/usr/bin/modulecmd bash $*`
}
This was working for me
#!/bin/bash -i // it will make this interactive

Resources