Scripting In BASH and Using the Command Line
Scripting In BASH and Using the Command Line
I am not having any trouble using the command line, and I use it to do a lot of things. I am not as adept as I should be for having been a Linux user for well over a year now, but let's just say I get the gist of it, but at the same time I would like to learn more.
On scripting, I haven't done any of that. From what I have read so far, near as I can tell, Puppy uses the ASH shell, which is different than other, more popular shells. I don't know much about the various shells... So, the way I understand this is that I would want to start to learn writing scripts in ASH because I am a hopeless Quirky and Puppy user (I say, "hopeless" because I try new distros all the time but always come back to Quirky).
Quirky comes with Geany and Leafpad, which should be fine for scripting, I think. Anything else I would need?
Can someone point me in the right direction to get this work started? Your help would be much appreciated.
[Update 21 July 2015: Puppy and Quirky use BASH shell -- my mistake!]
On scripting, I haven't done any of that. From what I have read so far, near as I can tell, Puppy uses the ASH shell, which is different than other, more popular shells. I don't know much about the various shells... So, the way I understand this is that I would want to start to learn writing scripts in ASH because I am a hopeless Quirky and Puppy user (I say, "hopeless" because I try new distros all the time but always come back to Quirky).
Quirky comes with Geany and Leafpad, which should be fine for scripting, I think. Anything else I would need?
Can someone point me in the right direction to get this work started? Your help would be much appreciated.
[Update 21 July 2015: Puppy and Quirky use BASH shell -- my mistake!]
Last edited by Blackfish on Tue 21 Jul 2015, 02:17, edited 1 time in total.
Dell Latitude E5500 w/ Intel Centrino processor-- running bionicpup64-8.0
Hello, BlackFish.
For everybody's information, the default script interpreter in Puppy is
bash. Ash is available in Puppy because it is part of the busybox kit, but
ash is not the default script interpreter in Puppy.
There is not much difference between bash and ash: ash is sometimes
twice as fast as bash but ash is more limited than bash. Also the syntax
for functions is different between the two and I believe that you cannot
process arrays in ash. (Someone please correct me if I am wrong.)
I'd suggest that you start scripting in bash. Once you've come up with
some result, if you need speed, try running your script with
#!/bin/ash instead of #!/bin/sh in the "crunchbang" line
(Linux lingo for the top line of every script).
If your script doesn't work with ash, don't worry about it, it will still run
in bash, right?
It's like swimming. You won't know how until you pinch your nose and
you jump in the water!
BFN.
musher0
For everybody's information, the default script interpreter in Puppy is
bash. Ash is available in Puppy because it is part of the busybox kit, but
ash is not the default script interpreter in Puppy.
There is not much difference between bash and ash: ash is sometimes
twice as fast as bash but ash is more limited than bash. Also the syntax
for functions is different between the two and I believe that you cannot
process arrays in ash. (Someone please correct me if I am wrong.)
I'd suggest that you start scripting in bash. Once you've come up with
some result, if you need speed, try running your script with
#!/bin/ash instead of #!/bin/sh in the "crunchbang" line
(Linux lingo for the top line of every script).
If your script doesn't work with ash, don't worry about it, it will still run
in bash, right?
It's like swimming. You won't know how until you pinch your nose and
you jump in the water!
BFN.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
I'm using Quirky and it is /bin/bash. My mistake. I found the way to check it and got it right. I will update the thread.
I get really confused, especially in the beginning, because I was running Ubuntu and started learning the command line from it. Then went to Puppy, then to Quirky, and many of the commands I learned with Ubuntu don't work in Puppy or Quirky. It's not the same. And many of the tutorials I find on the Web don't work, even though they are BASH shell. Often they are working from MINT or Ubuntu, and when I try to follow the instructions in Quirky, not all of it works. Perhaps it is easier and better to learn BASH and scripting from Ubuntu or MINT? I don't know.
Another trick I found is to open a terminal and press control + tab + tab. This lists (allegedly) all the commands. But having all the commands at one's fingertips doesn't explain everything. It certainly doesn't tell how to start writing scripts.
I get really confused, especially in the beginning, because I was running Ubuntu and started learning the command line from it. Then went to Puppy, then to Quirky, and many of the commands I learned with Ubuntu don't work in Puppy or Quirky. It's not the same. And many of the tutorials I find on the Web don't work, even though they are BASH shell. Often they are working from MINT or Ubuntu, and when I try to follow the instructions in Quirky, not all of it works. Perhaps it is easier and better to learn BASH and scripting from Ubuntu or MINT? I don't know.
Another trick I found is to open a terminal and press control + tab + tab. This lists (allegedly) all the commands. But having all the commands at one's fingertips doesn't explain everything. It certainly doesn't tell how to start writing scripts.
Dell Latitude E5500 w/ Intel Centrino processor-- running bionicpup64-8.0
Hello, blackfish.
Stop whining and start practicing with any one of these!
http://www.ask.com/web?qsrc=1&o=0&l=dir ... archTopBox
Get to work, man, get to work.
Best of luck.
musher0
Stop whining and start practicing with any one of these!
http://www.ask.com/web?qsrc=1&o=0&l=dir ... archTopBox
Get to work, man, get to work.
Best of luck.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- Lobster
- Official Crustacean
- Posts: 15522
- Joined: Wed 04 May 2005, 06:06
- Location: Paradox Realm
- Contact:
Ah @Blackfish
here is how to run your first bash program with Puppy
http://youtu.be/PXP1IiCjdE0
The reason some ubuntu programs may not run is because bash calls other programs which ubuntu may have and Puppy may not ...
more programming and bash in Puppy School
http://www.puppylinux.org/wikka/PuppySchoolProgramming
here is how to run your first bash program with Puppy
http://youtu.be/PXP1IiCjdE0
The reason some ubuntu programs may not run is because bash calls other programs which ubuntu may have and Puppy may not ...
more programming and bash in Puppy School
http://www.puppylinux.org/wikka/PuppySchoolProgramming
Last edited by Lobster on Tue 21 Jul 2015, 14:08, edited 1 time in total.
There is significant difference, IMO. To stay on the safe side, regard ash as almost a subset of bash, bash as almost a superset of ash, and do google for "bashism".musher0 wrote:There is not much difference between bash and ash
Finding complete documentation about ash is not so easy. There are many versions and implementations of ash, which differ from each other in subtle ways.
If you write an ash script and want to make sure it works also in bash my suggestion is to test the script thoroughly in bash.
It might also pay off to google for "POSIX shell".
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]
Got it. Nice lesson and good reading. Thank you.Lobster wrote:Ah @Blackfish
here is how to run your first bash program with Puppy
http://youtu.be/PXP1IiCjdE0
The reason some ubuntu programs may not run is because bash calls other programs which ubuntu may have and Puppy may not ...
more programming and bash in Puppy School
http://www.puppylinux.org/wikka/PuppySchoolProgramming
Dell Latitude E5500 w/ Intel Centrino processor-- running bionicpup64-8.0
Blackfish,
The CLI commands in Puppy are a subset of the full Linux command set. Our commands are provided by BusyBox. The web site for busybox is http://www.busybox.net and there is a good description of the commands and their options at http://www.busybox.net/downloads/BusyBox.html Note that some commands do not carry a full implementation of options. I have not found any impediment to anything that I have tried to do while using BusyBox
The CLI commands in Puppy are a subset of the full Linux command set. Our commands are provided by BusyBox. The web site for busybox is http://www.busybox.net and there is a good description of the commands and their options at http://www.busybox.net/downloads/BusyBox.html Note that some commands do not carry a full implementation of options. I have not found any impediment to anything that I have tried to do while using BusyBox
[i]Puppy 5.2.8.7, Full Install[/i]
As for me, I've found the stripped-down functions of busybox increasinglyHotdog wrote:Blackfish,
(...) I have not found any impediment to anything that I have tried to do while using BusyBox
frustrating, but this is a free world: Hotdog is entitled to his opinions!
BFN.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
I find that in learning BusyBox, many of the commands do nothing, appear to do nothing, or the command is not found, etc. I attribute this to being a quirk of Quirky. How accurate am I on that score? And if my thinking is accurate, what is the best Puppy Linux flavor for use in learning BusyBox better? Anything but Quirky?
Dell Latitude E5500 w/ Intel Centrino processor-- running bionicpup64-8.0