Use hugo commands in a shell

Hey !

I got a problem when i launch my site in command prompt with this :
./hugo server --baseURL=“http://lxdev03:1313” --bind=“0.0.0.0” --theme=hugo-theme-docdock --buildDrafts
Thats work great but when i try to launch this with a shell the command hugo is not find

How i have to write her ?

Thanks

Sounds like you need to set hugo in your PATH. I don’t know how to do that for Windows but you can look at how to use it for the shell you’re using on Windows

Can i put the PATH in my file or i have to put it in the bashrc file ? I’m using linux

Your hugo needs to be in your system path, unless, you type /path/to/hugo each time. So yes, you generally have to set that with something like .bashrc or equivalent, per your shell’s man.

Ok thanks ^^

Sure. By the way, you mention “command prompt” then “shell”, and “working” then not. To me those words are synonymous. What do you mean by them?

I mean in command prompt this

and in shell, just a file run by the command prompt

My problem is my command, it work in command prompt but not in my file

And i can’t change the bashrc file because i don’t have the rights for now

1 Like

That’s so unclear. Command prompt is the console environment for Windows that’s why I assumed you use windows. On Linux and other Unix/BSD derivatives we often use a terminal instead. Also here’s a simple solution. If it works in one console interface and not in another you could run which hugo where it works and see the path it gave. Assuming it’s /usr/local/bin/hugo then you could do this in the shell export PATH="/usr/local/bin:$PATH"

1 Like

@Tclavier thanks for trying. Still not so clear. Agree with @silverdust that “command prompt” is the Windows term.

Anyway: is it possible you’re shelling out from an editor or something? The Terminal, and indeed different terminals, a shell from an editor, the env in cron, are sometimes different, so you need to dig in and figure out why your hugo is not being found.

Or are you trying to say it’s different when you direct connect to the system, versus, ssh to the system?

Another thing that could happen is, if you’re using different terminals / shells, and you have bash specified in one but zsh in another, they don’t use the same rc files. Hence, the possibility of different paths unless you specify it.

I don’t understand, you ask if i’m using different terminals ? I use 2 terminals, my command line work in both but no witht my file sh
I looked and i have just one rc file

I’m sorry for my low level in this but i really don’t see what i have to do