why I am in this trying to figure out what I done wrong mess. As was mentioned before I deleted and started over. This is a fresh install of windows 11 about 4 days now. I did add the folders to my system path. And do not get the program that #1 back up company that starts with an A and ends with an S. When their file goes corrupt and it's like pretty much oh well. Not much. But here we go. Look at the photos. I am going to try and format this again. How the hell do you know what line this thing is bitching about. There is only 6 lines of code in this thing. The rest is my troubleshooting. ~~~
local x = math.pi
local r = 6
local Area2 = (x * r ^ 2)
local Area = Area2-Area2%0.01
print(Area = ..Area.. Oh Yea)
* Executing task in folder MA_scripts: lua54 c:\Users\iSpeedyG\OneDrive\Documents\MA_scripts\LuaUdemy\4_Variables_Expressions\circleArea.lua
Area = 113.09 Oh Yea
* Terminal will be reused by tasks, press any key to close it.
**"DEFAULT COMMAND PROMPT above"** ALL THIS IN VSCODE
------------------------------------------------------------
* Executing task in folder MA_scripts: lua54 c:\Users\iSpeedyG\OneDrive\Documents\MA_scripts\LuaUdemy\4_Variables_Expressions\circleArea.lua
C:\lua\lua54.exe: cannot open c:UsersiSpeedyGOneDriveDocumentsMA_scriptsLuaUdemy4_Variables_ExpressionscircleArea.lua: No such file or directory
* The terminal process C:\Program Files\Git\bin\bash.exe --login, -c, lua54 c:\Users\iSpeedyG\OneDrive\Documents\MA_scripts\LuaUdemy\4_Variables_Expressions\circleArea.lua terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
**"DEFAULT BASH PROMPT above"**
----------------------------------------------------------------
Next I added a file all the way in my c:\lua called just checking.lua. 1 line of code
1. print(Trying to figure out why i cannot run a lua from cmd line. thinking it has someinthing to do with my docs folder now in one drive.)
* Executing task in folder MA_scripts: lua54 c:\lua\justchecking.lua
C:\lua\lua54.exe: cannot open c:luajustchecking.lua: No such file or directory
* The terminal process C:\Program Files\Git\bin\bash.exe --login, -c, lua54 c:\lua\justchecking.lua terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
**"DEFAULT BASH PROMPT above"** ```FROM BEFORE DIDNT CHANGE IT```
-----------------------------------------------------------------
* Executing task in folder MA_scripts: lua54 c:\lua\justchecking.lua
```*Trying to figure out why i cannot run a lua from cmd line. thinking it has someinthing to do with my docs folder now on one drive."*```
* Terminal will be reused by tasks, press any key to close it.
**"DEFAULT COMMAND PROMPT above"** ```*"THESE FOUR above WERE WITH CTRL+SHIFT+B -->Terminal Menu--run, build, task"*```
---------------------------------------------------------------------
```"NOW JUST GOING TO TYPE THE COMMAND IN BOTH FROM PROMPT AND THEN LUA54 NOTE EVEN CHANGED DIRECTORY TO WHERE THE FILE IS DEFAULT FOLDER IS ACTUALLY SET TO MA_SCRIPTS SET FROM LOADED WORKSPACE"```
c:\lua>lua54
Lua 5.4.2 Copyright (C) 1994-2020 Lua.org, PUC-Rio
lua justchecking.lua
stdin:1: syntax error near justchecking
justchecking.lua
stdin:1: attempt to index a nil value (global justchecking)
stack traceback:
stdin:1: in main chunk
[C]: in ?
os.exit()
c:\lua>
**"DEFAULT COMMAND PROMPT above"**
-------------------------------------------------------------------
iSpeedyG#iSpeedyG-PC MINGW64 ~/OneDrive/Documents/MA_scripts
$ cd c:lua
iSpeedyG#iSpeedyG-PC MINGW64 /c/lua
$ dir
justchecking.lua lua54.dll lua54.exe luac54.exe wlua54.exe
iSpeedyG#iSpeedyG-PC MINGW64 /c/lua
$ lua justchecking.lua
bash: lua: command not found
iSpeedyG#iSpeedyG-PC MINGW64 /c/lua
$ justchecking.lua
/c/lua/justchecking.lua: line 1: syntax error near unexpected token Trying to figure out why i cannot run a lua from cmd line. thinking it has someinthing to do with my docs folder now in one drive.
/c/lua/justchecking.lua: line 1: print(Trying to figure out why i cannot run a lua from cmd line. thinking it has someinthing to do with my docs folder now in one drive.)
iSpeedyG#iSpeedyG-PC MINGW64 /c/lua
$
**"DEFAULT BASH PROMPT abpve"**
-------------------------------------------------------------------
I have no understanding what happened here. I dont know where I screwed up the path on install. I only created the just checking thing because that was where I placed the Binaries in the beginning right at C:\ but MA_Scripts is in my documents folder and notice when I put it in OneNote it politely just moved the folder to the cloud. Going to see if I can attach a photo of my enviroments. I tried to show as much information as I can. I am running through a course online and tried to do
The run from command line like he does and thats when I found this issue out. I hope it is something simple. I am pretty new to this whole thing and have been on a roller-coaster for a few months hence the reformat and new windows the other day. Thats a longer story. On an added issue at 1st CTRL+L used to select the line. Now it doesnt after I turned sync with github account on. I dont even know where to look. Thanks in advance. There are numbers in front of the code they just dont want to copy for some reason.
[Picture of all of this I have pasted][1]
[picture of my PATH][2]
[1]: https://i.stack.imgur.com/YWgZF.png
[2]: https://i.stack.imgur.com/fztGU.png
Related
I try to use julia-1.6 with VScode, but I cannot find a path to the executable.
When I try to change the working directory via the julia prompt to the executable, I get an error message saying it's not a directory:
julia> cd("/Users/jjdegruijter/bin/julia")
Can anybody tell how to do it properly?
To get the path to your Julia executable, from the REPL, do:
joinpath(Sys.BINDIR, "julia")
You can start a REPL by just running julia from the terminal, or by pressing Alt-J Alt-O in VS Code (you can also instead type Ctrl-Shift-P, then choose Julia: Start REPL from that list).
Or, you can also directly run the above command from the terminal without starting a REPL: julia -e 'println(joinpath(Sys.BINDIR, "julia"))'.
If you just want to change working directory to the directory containing the executable (though I'm not sure why you'd want that here):
cd(Sys.BINDIR)
I'm sort of new to programming (not really, but I'm still learning - aren't we all?). Although I know Java and Python and sort of know C, C++, JS, C#, HTML, CSS, etc. (and I can navigate pretty well in the terminal), I am not familiar with what $PATH is in the terminal.
I've been using the Linux terminal and Mac terminal much more frequently than I used to (if I even did at all two years ago), and I know for python, it wants you to "export" its path like PATH=\path\to\python\bin:${PATH}\ export PATH. However, I don't even know what it does. I tried to find out, but all I could find were people saying "export this path and export that one."
So, what is it and why use it? I understand that (if you do it for Python), it basically makes 'python' (or 'python2' or 'python3') a variable, but I just don't understand the concept of what it is.
man bash describes it as:
PATH
The search path for commands. It is a colon-separated list of
directories in which the shell looks for commands (see COMMAND
EXECUTION below). A zero-length (null) directory name in the
value of PATH indicates the current directory. A null directory
name may appear as two adjacent colons, or as an initial or
trailing colon. The default path is system-dependent, and is
set by the administrator who installs bash. A common value is
/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin'.
When you run a command, like python, the operating system tries to find the python program in the list of directories stored in PATH.
Suppose your PATH is /usr/local/bin:/foo:/bar:/baz:/usr/bin. When you try to run the python comamnd, the operating system will look for an executable named python in those directories in order. On Linux, you can watch it do this with the strace command:
$ PATH=/usr/local/bin:/foo:/bar:/baz:/usr/bin strace -f /bin/bash -c 'python --version' 2>&1 | grep 'stat.*python'
stat("/usr/local/bin/python", 0x7fff98b63d00) = -1 ENOENT (No such file or directory)
stat("/foo/python", 0x7fff98b63d00) = -1 ENOENT (No such file or directory)
stat("/bar/python", 0x7fff98b63d00) = -1 ENOENT (No such file or directory)
stat("/baz/python", 0x7fff98b63d00) = -1 ENOENT (No such file or directory)
stat("/usr/bin/python", {st_mode=S_IFREG|0755, st_size=4864, ...}) = 0
As soon as python is found in /usr/bin/python, the search stops, and the program runs.
I'm new to Ruby and am trying to make my way through the Hartl tutorial. I ran into a couple issues this morning and am afraid that I might have made one of them worse.
I was doing fine in the tutorial until I got to the Heroku deployment section of chapter 1 and realized that I had yet to setup the Sublime Text 2 "subl" command so that my terminal could interact with Sublime Text.
I then went on a chase to figure out how to get the subl command to work. While trying to get that figured out, I came across this thread (Installing Sublime Text's command line tool 'subl' in terminal, permission denied?) and went ahead and changed directories to the "mkdir bin" so that I could run "sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl" and get my subl command line to work.
Well, when I entered the "sudo ln -s...." line it asked for a password and basically said I should be careful what I was doing. In light of that, I just want to return to my "first_app" directory and try to figure stuff out a different way. Only problem is, when I hit "cd first_app" it tells me there is no such file or directory... I'm starting to freak out a little bit now...
How can I get back to the first_app directory? Surely it's not gone?!' <-- most important!!
If I can get back to the first_app directory, how in the world can I get the subl command line so that I can continue on with deployment, etc...?
Any and all help is much appreciated as I try and work through this really frustrating phase.
UPDATE: I just changed it back to the first_app directory -- what is the best way to get this subl command line working?
Depending on what directory you're in, if you try to cd first_app, it may not be a sub-directory of the dir you're currently in.
Some basic linux commands to help you out:
cd .. <-- Moves up a level
pwd <-- Shows where you currently are in the directory structure
ls <-- Shows files/folders that exist in the directory you are in.
I'm just getting into ruby and am trying to execute a walkthrough from Sam Ruby's Agile web development.
I've created a directory using mkdir work
Next i'm instructed to open a terminal and type rubys> cd work
The error I'm getting reads:
No command 'rubys' found, did you mean:
Command 'ruby' from package 'ruby' (main)
rubys: command not found
Can anyone inform me of what I'm doing wrong?
I've also tried changing from ~ to the work directory before entering my command.
In this book, rubys> is a command prompt, much like you have C:\> in the Windows terminal.
Ignore that first bit and everything should start working.
I guess you're doing it wrong.
mkdir work
creates a directory called "work". It has nothing to do with Ruby.
cd work
will then change into that directory. Forget about the rubys>.
I'm trying to modify a legacy Delphi 5 app so that it can be launched either from it's icon/via Explorer, or from the console (command-line). When it gets launched from the console, I want the program to detach itself from the console process, so that the console can continue to execute other instructions without waiting for my program to terminate.
I want to use it in a 'batch' file, such that I might have;
#echo off
rem step 1 - do some stuff here
rem
rem step 2 - launch my app
c:\myfolder\myapp
rem
rem step 3 - do some more stuff here
and that the console process moves on to step 3 straight after launching my app in step 2.
I'm sure I've done this before, many years ago, but I'm puzzled as to what exactly I did. I don't want to write a tiny console app 'launcher' for my main Windows app - I'm 95% sure that there was a way of doing this within a 'normal' Delphi GUI app.
I guess I could use vbscript or powershell or something to 'execute' my program with some kind of 'nowait' parameter but the client is familiar with batch files and I don't really want to upset the applecart by suggesting he change his scripts or install additional stuff - I'm making changes to the executable anyway and it would be great to tick this box for him too.
Anyone? :-)
I think the START command is the one you're looking for. It starts a process separately to the console and it's part of cmd.exe so no extra software required.
But I was of the opinion that GUI apps did this anyway. Maybe Delphi is different to MSVC.
Open up a console and type "start /?".
As itowlson states in the comments, GUI application do generally detach themselves. It's the actual cmd.exe shell doing trickery in that it waits for it to finish if it's running from a cmd file.
So "notepad" from the prompt will start it in the background but "notepad" within a cmd file will wait. Within the cmd file, you need to use:
start notepad.exe
or whatever your application is called (not notepad, presumably).
try: start "" c:\myfolder\myapp (with the empty quotes)
I think Microsoft has been solve this problem in Windows Power Shell.
In command prompt, even if you use "start ", you cant detach your process really from cmd. If you close the cmd, you will die, suddenly. But In windows Power Shell, you can detach your program or command from Power Shell as default.
So, if you prefer to use Windows Power Shell instead of Command Prompt, just do this:
PS: X:\> <your command>
Here's one way that I've found. It works quite cleanly and doesn't leave any extra cmd windows around (the recommendation to use start c:\myfolder\myapp does not work:
cmd /c dir && c:\myfolder\myapp
To quote the CMD help:
/C Carries out the command specified by string and then terminates
Note that multiple commands separated by the command separator '&&'
are accepted for string if surrounded by quotes.
Apparently it notices that the dir command terminates and exits, even though your app was launched on the same command. Chalk it up to one of Windows vagaries.
u should use the cd command example
cd/
cd myfolder
start myapp
exit