0

I just came across this line of code in a script I'm working with, because I don't have vim installed: vim bots/*/run_bot where bots is a directory in the current working directory and run_bot is a script file inside a subfolder of bots
Isn't vim supposed to be an text editor? This line is inside an "installation script", so interaction with the user isn't going to work...

Any help is appreciated!

  • Can you show the lines before and after this, and the real syntax of your example. – Soren A Feb 19 '17 at 19:58
  • I edited my question to explain the scenario a little bit more... The context won't help you much, because I believe this line isn't needed at all, maybe just a workaround to create a file or whatever – RoiEX Feb 19 '17 at 20:05
  • That commend will just open one or more 'run-bot' files depending on what the wildcard '*' expands to ... there has to be something more going on. Please show the original line, and a few lines before and after it, from the script. – Soren A Feb 19 '17 at 20:11
  • This command isn't preventing the script from being executed further, right? I believe that this is just a cheap way to test if this file exists, and error if it doesn't... earlier in the script file set -eu is executed – RoiEX Feb 19 '17 at 20:16
1

This would do the following:

  1. Search through every folder in the bots folder for files named run_bot
  2. Open every matching file for editing in Vim

Example:

That means if you have the following hierarchy: bots/folder1/run_bot and bots/folder2/run_bot this command would be the equivalent of writing:

vim bots/folder1/run_bot 

and

vim bots/folder2/run_bot

It's pretty common to use the wildcard (*) sign when you want to open or edit several files. This is standard bash syntax.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.