Issues with script files created with notepadqq

raytreid

New Member
Joined
Feb 2, 2022
Messages
6
Reaction score
3
Credits
58
Hi,
I'm not sure if this is the correct spot for this question but only one way to find out.

I just installed Ubuntu 20.04.4 on a Lenovo laptop as the only OS. Everything went well, then I got lazy and installed a text editor so I wouldn't have to use vi. Its been a while.

I created a simple hello world perl script using vi just to see if it would work, saved it to a directory I created in my home directory. It ran fine, then I created seemingly the exact same script, just named different using notepadqq but when trying to execute it I get the error "No such file or directory" I got the same error when I tried to execute chmod on the file.

After all that my question is, are there any known issues using a GUI text editor to write scripts on a linux box?

Or is there anything out there I should be using other than notepadqq?

Thanks,
Ray
 


G'day Ray :)

I'll move this to Command Line, where scripting inquiries are also handled.

Good luck.

Chris Turner
wizardfromoz
 
It shouldn’t matter what editor you use, regardless of whether it’s a GUI, or TUI based editor.

This is almost certainly some kind of user error on your part. But you haven’t really given us a lot of information.

Can you share the code in the scripts?
Also, where were the two scripts saved?
What directory were you in when you tried running the scripts? What commands did you use to run your script, when you get the error?

Did you use a shebang in your script, to tell the shell which interpreter to use when opening the script?
E.g.
Bash:
#!/usr/bin/env perl

If you can give some more concrete details of what you’re doing, it will be easier to work out where things are going wrong.
 
Last edited:
It shouldn’t matter what editor you use, regardless of whether it’s a GUI, or TUI based editor.

This is almost certainly some kind of user error on your part. But you haven’t really given us a lot of information.

Can you share the code in the scripts?
Also, where were the two scripts saved?
What directory were you in when you tried running the scripts? What commands did you use to run your script, when you get the error?

Did you use a shebang in your script, to tell the shell which interpreter to use when opening the script?
E.g.
Bash:
#!/usr/bin/env perl

If you can give some more concrete details of what you’re doing, it will be easier to work out where things are going wrong.
Hi,

The code is as follows:

#!/usr/bin/perl -w
print ("Hello world!\n");

The code is located in a directory perl I created off home

/usr/raytreid/home/perl

The permissions on perl are
drwxr-xr-x

I am running it from
/usr/raytreid/home/perl

The same exact code with all the same details when crested in vi works fine.

I think notepadqq is putting some sort of special character(s) in it but that is just a guess.

Thanks,
Ray
 
geany is a good coding and light IDE ; if you created your perl script with geany , you can also run it using geany
 
Hi,

The code is as follows:

#!/usr/bin/perl -w
print ("Hello world!\n");

The code is located in a directory perl I created off home

/usr/raytreid/home/perl

The permissions on perl are
drwxr-xr-x

I am running it from
/usr/raytreid/home/perl

The same exact code with all the same details when crested in vi works fine.

I think notepadqq is putting some sort of special character(s) in it but that is just a guess.

Thanks,
Ray
Okay, so this is working now. I've never really used Linux, I had a Unix terminal at a past job about 10 years ago. So I've never done the install of the OS. Anyway I noticed this round icon on the activities bar (not the one with the question mark). I clicked it and it informed me that a reboot was needed for the setup to be complete. I did that and now can run scripts that I created in notepadqq.

Sorry for the confusion.

Other than this minor bump, the install was easy and when done everything works with little to no additional set up.

Thanks,
Ray
 
The code is located in a directory perl I created off home

/usr/raytreid/home/perl
I don't know about old Unix, but for future reference: all Linux distributions have standardized "home" as /home/username/.

So, if you do these commands with no other options:
Code:
cd
pwd
Then cd will take you to your home from anywhere in the filesystem, and pwd will then show /home/raytreid. Also, ~/ is an often used shortcut for your home, so you might use a path reference to a file like, ~/perl/script-name, instead of the longer absolute path of /home/raytreid/perl/script-name.
 

Staff online

Members online


Top