Vim-written script show error, and exact same one doesn't.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Vim-written script show error, and exact same one doesn't.
I wrote a shell script (using vim). After I run it an error was shown: directory doesn't exist, but after checking path, directory tuned out to be OK.
I copied the script content to clipboard and than pasted it to a new file at the very same directory (It was out of despair after half-an-hour of trials, I didn't even hoped that would work). That new script worked just fine. "diff" showed no difference between the old and the new one.
What could the problem be??? Did I made smth accidentally in vim? I googled, but with no success.
* Script was run on CentOS remote server.
Could be an invisible ctrl-char the first time. Not sure if copy/pasting to/from clipboard would solve that, but it might depend on the ctrl-char value.
Try
I feel like a fool... Old version worked, still as far as I can remember, I only opened and closed it once, while copying. But I still have an error file as a proof of that I'm not seeing things. And of course, :set list showed nothing but end-of-file characters.
Maybe I should've mentioned it earlier, but I 've run my script on cluster, so that might be the case...
I thought about vim because some time ago I had a problem with 10-line program that gcc didn't want to compile and I solved it by deleting and retyping all white space characters in mentioned line.
PS - But still, is it possible to accidentally insert an invisible escape character or something like this in vim while typing? Or paste it while inserting path?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.