Issue with .sh file

In one of my previous exams, I was given file and files. I was asked to edit and execute these files. To my surprise when I tried opening using vi, the file was empty. I had a feeling that opening using vi wiped off the file contents and made the file size zero. Can anyone please advice if I was doing something wrong there ? Your response will be appreciated throughly.

I faced the same issue as well but not sure about the solution. I am not planning to attempt again without knowing a solution for this issue since I was unable to attend 3 questions in spark due to this issue.

@Bigdata_Aspirant, @santy By any chance did you guys checked size of the file prior to “vi” editor ? just curious to know what command used to come out of “vi” editor

i have been following this question for some time now and have seen that santy also faced the same issue.
one thing i want to know.

  1. did you give the correct path of the file while opening in vi, because any other path would have opened a new file of the same name with zero byte.
    did you try quitting the vi editor without saving and re-opening the templates.
  2. did you do a cat , before doing a vi and were able to see the content ?

I remember giving the correct path of the file since I copied it from the question and pasted it in the command line but I did not quit without saving since I used ‘:x’. I do not remember using the cat command.

If we find any of such things during exam can we able to talk to proctor and bring this to his attention.

Thank you very much for your responses. I spoke to exam management person yesterday and he also pointed out the same issues. I believe I did check for size, then opened using vi with correct filename or pathname. But not sure if I did save it before closing, well we do some mistakes under stress. But here is the list of things we should do I assume to avoid this mistake going forward.

  1. check if the exists and it’s size with ls command.
  2. cat the file to see its contents.
  3. carefully copy the filename and open using vi.

The guy who sits and monitor your exam is to verify that you are not cheating. He would not help you with technical issues. I did escalate this thing to him and he gave a generic answer that there was no issues with exam.

As the code snippet was empty, I tried executing program using pyspark, but whenever I performed any action ( a smaller one), say take (5) it would take ages to execute.

I would say the exam was very easy I would have easily scored 100 but the cluster was very challenging in many cases. I was able to complete atleast 15 different questions in 2 hours on my vm during my practise tests. I shall reattempt this but honestly I am bit worried, what if the same thing repeats.

Thank you very much for your help and cooperation everyone.

Which exam? CCA? You should raise the issue to Cloudera.

Yes sir, I did raise this issue with cloudera but they are not ready to accept that the file opened empty. I also spoke to python expert in my office. He said sometimes vi tool can assume a new .py is being created when certain flags are not in the command. This might be similar to the nano, as nano editor takes -w as a parameter.

I thought of a plan,
I will cat first to make sure contents are present, make a backup file and then use vi to open. Such that, if I over write using vi, I will have my backup file to copy from ( using cat and copy paste in vi )

If you can think any other editors that I can during exam, please let me know.

Thank you very much for your help and support !!

Also it will be good to use advanced editors such as sublime text.

Sure sir. Can I practise sub lime in the cloudera VM ? How can I find it in the exam ? Thanks again.

Yes, you can install in Cloudera Quickstart VM.

Sure sir. Thanks again.

Thanks all for all of your responses. As mentioned by Bigdata_Aspirant, I am also worried about this problem repeating in my next attempt, however, I would try out the methods specified above and also practice using sublime editor.

The exam proctor said he does not know anything about the exam and was only there to monitor me, so no point raising these questions to the proctor during the exam.

Is sublime text available in bigdata-labs?

sublime text will not be available on the bigdata-labs. It is developer tool and you need to setup on your laptop.

In certification, they will provide remote desktop which will have access to cluster. Remote desktop will have sublime text.