Problem with scripts


(Giorgos) #1

Hi! :slight_smile:

I have a problem with script files (.sh). Except from internal commands (ls, dir etc), all the rest failing with the message “command not found”.

The very same commands, when typed from terminal, are working as expected. Eg. giving “eject” from termminal, ejects the tray. Writing a script (eg. TEST.sh) with just one line (eject), making it executable and giving from terminal (from its directory) “./TEST.sh”, returns “command not found”.

I’m on Debian stable and installed LXQt from repositories. Any hints??? TIA! :sunglasses:


(Alf Gaida) #2

i don’t know how to put it mild - but please learn the very basics - and set the envionment right - at least the command processor and the path.

Ever think of where crunchbang get the name from? Ok, enough hints.


(Giorgos) #3

Dunno about crunchbang! Never tried. But for Debian, let me give you my own hint! :slightly_smiling_face: What’s in the PATH -> is in the PATH. Again, for Debian, one PATH for everything. NOT a PATH1 for something and a PATH2 for something else. Once you fire up a console, you can see the PATH (if you want to) and unless you change it, it stays valid, both for what you type in the terminal and for what scripts are trying to run.


(Pedram Pourang) #4

LXQt forum is what its name says. It’s not for teaching the basics of bash scripting. Use google for that.


(Alf Gaida) #5

@Giorgos: And please get a clue about debian and Linux at all. Not that i have any experience with Debian - just try apt changelog lxqt

Btw - you are wrong.


(Giorgos) #6

apt changelog lxqt E: Failed to fetch changelog:/lxqt-metapackages.changelog Changelog unavailable for lxqt-metapackages=13

Now how its supposed useful???

OK guys! Whatever! I’m not here to disagree with you. I just gave it a try, but it needs A LOT of work before being ready for every day’s use. I’d rather continue with another desktop with a traditional way to deal with users. Maybe we’re all wrong and only lxqt have the real linux way.

Over and out! Best of luck for you and your project!


(Pedram Pourang) #7

Thanks and good luck with learning bash scripting!


(Alf Gaida) #8

@tsujan - maybe we should be more constructive next time - not really needed, but nice :slight_smile:

#!\bin\bash

# ^^ crunch bang processor, wikipedia says
# CrunchBang (abbreviated #!)
# and please don't use /bin/bash - we at debian don't like bashisms
# #!/bin/sh might be better, esp. because debian use dash instead of
# bash for system accounts

next thing might be: hell - make it executable

chmod 755 foo

and please remember the obvious: only things in special directories will be treated as executables - /bin;/sbin;etcpp
for a local file in a local directory it need a full path to the file to be executed - ./ might be a start. Anyways, have fun …


(Pedram Pourang) #9

@tsujan - maybe we should be more constructive next time

In rare cases, I prefer to be happy with my character flaws instead :wink:


(Alf Gaida) #10

you are right - as so often