LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-23-2012, 10:26 AM   #1
umbrella22
LQ Newbie
 
Registered: Feb 2012
Location: Moscow
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 02-23-2012, 11:04 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
If diff showed no differences then there should be no differences. Did you try running the vim-created version again?
 
Old 02-24-2012, 06:24 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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
Code:
:set list
in vim
 
Old 02-24-2012, 01:38 PM   #4
umbrella22
LQ Newbie
 
Registered: Feb 2012
Location: Moscow
Posts: 2

Original Poster
Rep: Reputation: Disabled
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vim: command to show all non-printable chars. stf92 Linux - Newbie 2 12-06-2010 04:44 AM
service start script doesn't show OK or FAILED bboopathi Linux - Newbie 2 07-18-2010 02:41 AM
Show line and column numbers in Vim 7.0 judgex Linux - Desktop 1 08-29-2006 07:06 AM
Do not show ls error in bash script Rindert Linux - General 2 08-18-2006 06:28 PM
MBR over written... boot floppy doesn;t work sodhilogin Linux - General 5 07-19-2004 07:27 AM


All times are GMT -5. The time now is 08:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration