I am learning to create my own scenario in katacoda. I want to open a file that I created in the katacoda editor, but it's not letting me use the open command in my background.sh file. This is what I have in it so far:
touch my-project/new.py
echo "print('Hello World')" >> my-project/new.py
open new.py
This creates the python file, but it does not open it. I tried running open new.py in the terminal, but it gives me an error
bash: open: command not found
I can click on it in the file tree to open it, but I want it to open automatically. What other command can I use to open it in the katacoda editor?
After messaging support, you are not able to put code in a file that is opened on start in Katacoda. You can embed links that will add code when the user clicks on it, but that's a different task. Katacoda does not support the "open" command, but you can use vim or nano.
Related
I have a file called start.sh in the explorer tab of VS code. When I go to the terminal in VS Code it loads up the power shell terminal as the default. When I go to the directory where the file is cd ... and later type in ./start.sh it does not run the script, and instead opens the file in my editor. Does anyone know why on Windows this happens?
In vscode, right-clicking in the explorer on a file (or folder) and selecting "Open in Integrated Terminal" will create a new integrated terminal at the path of that directory.
Is there a way to open that directory in the currently open integrated terminal? Ideally without having to copy the path and type "cd " and paste the path.
I feel like I'm missing something.
If not, are there any extensions that do this? Using macOS.
What I've Tried
I've searched for and could not find a way to do this.
I use the vscode extension "Terminal Sync", but you must have a file open in the editor and the file must be the current one being used in order to cd into that file's directory in the integrated terminal
Is there an equivalent or similar command for WebStorm like code . which automatically opens the directory with the VS Code editor?
Thanks to the #LazyOne comment telling me to check the command-line interface I found the answer here.
The most similar command would be:
In Windows write > webstorm.bat to open the editor from the cmd or in case you want to open a project adding the path after it > webstorm.bat C:\MyProject
In macOS, after creating a launcher script it would be $ webstorm to open the editor or in case you want to open a project $ webstorm ~/MyProject
I am currently grading for a C++ class and want to be able to download all the files my students submit and when I click on them they open in Geany so I can compile them really quickly and run them.
When I ran linux I used Geany as my preferred IDE. I've switched to Mac and installed Geany via MacPorts. I currently run Geany by opening a terminal and calling it.
Is there a way to specify a custom command for a file type or will have to build an application to run Geany. Also how do I do that. I tried messing around with automator and applescripts, but couldn't get very far.
I believe this is what you want
Use Applications -> Automator -> Application -> Run Shell Script
Change the "Pass input" to "as arguments"
Change the
echo $f
to the full path to your geany executable. Leave the $f
/the/full/path/to/geany $f
Save the Automator app. Give it a name you like.
selecting Get Info (⌘I) in the Finder, and then setting Open with: to Geany and clicking the Change All... button. If that doesn't work I'll need to look into it further.
Source
I'm on a Mac, and have a bash script that works very nicely.
I'd like to make it so that a double-click will run it, but I don't know the "open with" operand. Please, what am I missing?
You'll need to make the file an executable.
On the first line, before any of your code put in a shebang
#!/usr/bin/env bash
REST OF YOUR CODE HERE
Next, you'll need to change the permissions. On the terminal run:
chmod +x your_bash_file
Finally, you will need to make sure OS X opens the file using the Terminal and not the application that created the file e.g. your favourite text editor. You can accomplish this in 1 of two ways:
Save the file with no file extension (eg. bash_file, instead of bash_file.sh)
Or, choose File -> Get Info and set Open with: to Terminal.app
You should now be able to click on the script to execute it!