[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

What makes bash so special as opposed to other command lines

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 37
Thread images: 4

File: bash.png (106KB, 1024x768px) Image search: [Google]
bash.png
106KB, 1024x768px
What makes bash so special as opposed to other command lines like windows command prompt and where can I learn how to use it?
>>
Use the help command.
>>
>>55888864
>where can I learn how to use it?

https://www.codecademy.com/learn/learn-the-command-line
>>
>>55888864
>What makes bash so special as opposed to other command lines like windows command prompt
mostly the language used to do things in bash. there isn't anything else really special about it. command prompt sucks because windows was designed for it to suck.
>>
>>55888864
well , it has a pedigree, design
windows command prompt is a toy
not something professionals use
>>
As opposed to the Windows command prompt? Bash would be marginally better, but the main reason that bast is so much more popular is that on Windows GUIs are the primary way to get the job done and thus favored over CLIs, while bash (and other *shs) often come before graphical shells in the unix world, among the other reasons the fact that there's no standard unix desktop environment.

Microsoft has since stepped up its command line game with Powershell, which is a considerably different approach when compared to bash and most other shells. It can manipulate objects, not just strings, and can talk to .NET programs. I suggest you have a look at that too.

>>55889118

I'm sure that if people were forced to use cmd, like they were/are forced to use bash, cmd wouldn't be dismissed as a toy.

To be clear, I think that most shell scripting languages suck hard, and should be replaced by proper programming languages. In this context, Powershell is a step towards sanity.
>>
File: image.png (198KB, 492x650px) Image search: [Google]
image.png
198KB, 492x650px
>>55888864
I absolutely love this book. I'd check it out before anything else.
>>
>>55889223

I forgot something. Apart from the sh language itself, the unix shells are famous for being used to script and "pipe" together various, very powerful utilities that come together with most unix systems. Most of those utilities have no direct counterpart on Windows.
>>
>>55888864
With bash it's relatively easy to automate administrative tasks. It works particularly well with Unix-like systems. The Unix tools are relatively simple commands that are able to perform some simple (usually text based) tasks, for example sed and grep. Bash and other shells can work as glue to connect these tools together.
For example, you can write a command that removes spaces in a filename.
If you know bash, it's trivial to run that command on a directory with thousands of files.
Stuff like that is where shell languages are really useful.
What makes bash superior the windows command prompt are programming and interactive features like wildcard completion, program argument completion, pattern matching.
>>
File: 1419650956385.jpg (35KB, 637x480px) Image search: [Google]
1419650956385.jpg
35KB, 637x480px
Being able to pipe output from small simple utilities into the input stream of other useful utilities is the strength of bash (and shells like it). Cating the output of a run command into a text file to generate an error report and so on. You can daisy chain and automate system processes much easier.

Pic not related
>>
>>55888864
it's significantly more scriptable than cmd.exe

That's like 90% of the reason -- a large amount of basic shell scripting tasks are pretty doable in both, and a lot of common commands called in bash scripts are separate programs that you could also call from cmd.exe anyway.

>>55889223
>To be clear, I think that most shell scripting languages suck hard, and should be replaced by proper programming languages.
fucking this, so much

Sure, you can write pretty much anything you want in Bash. It's like pulling teeth though, it's a disgusting fucking language that's visibly just kludge on top of kludge, and there's like 3-4 different ways to do the same task, all of them with weird gotchas.
>>
>>55889223
>I'm sure that if people were forced to use cmd, like they were/are forced to use bash, cmd wouldn't be dismissed as a toy.
If people (UNIX weenies) were forced to use cmd, they would stop using it and write sh.
>>
>>55892067
>It's like pulling teeth though
Right tool for the job.

find . -name "*.wav" | parallel -u ffmpeg -i '
{} -c:a flac {.}.flac


Try writing that in your favorite programming language.
>>
>>55888864
it's shit. fish is better
>>
>>55889223
There's also the fact unix has no concept of a graphical program. Windows programs have two different entry points, main and WinMain, and WinMain programs have no command line output - that's how integrated graphics are to Windows..
>>
Powershell > *

bash is trash.
>>
>>55895700
powershell is smartly designed, but it's microsoft's response to people begging for a standard shell. in that context, powershell is useless.

all anyone wanted was a standard shell. giving us something other than what we asked for on the basis of MS's bizarre logic of what we *really* want comes off as an autistic person who doesn't really help when we ask for advice or solutions.
>>
>>55889043
>kek
>>
Bash on Ubuntu for Windows. Thoughts?
>>
windows cmd prompt is just fucking weird. So many tiny details or behaviors that are just odd and make your life harder to work with.

At my job we had our entire dev enironment set up with bash scripts and it was a nightmare. Eventually we had someone port everything to powershell which.
>>
>>55889232
should i read it?
>>
File: _20160803_153918.jpg (45KB, 525x275px) Image search: [Google]
_20160803_153918.jpg
45KB, 525x275px
>>55889223
>sanity
Pic related is how you check a file md5 checksum on powershell
>>
>>55897334

Or... You could just use the Get-FileHash cmdlet

https://technet.microsoft.com/en-us/library/dn520872.aspx
>>
>>55897490
Does it work on windows server 2008?
>>
>>55889341
Yeah, you can bind many commands together, that was the modular point of UNIX in the first place, >>55889223 obviously does not get that
>>
>>55897528

Check your powershell version, this works on 5.0 up. You might need to upgrade.
>>
>>55896139
If you want to learn the CLI, some bash scripting basics, and and get an introduction to UNIX-like operating systems you should read it.
>>
>>55896139
I'm reading it now. It's pretty handy, and it's less dry than most books on the subject. So i would say it's a decent resource
>>
Bash or *nix shell in general are useful because of *nix cli tools.

Not everyone use bash for scripting, so equating bash to powershell are stupid.
Most people use bash interactively.
Otoh, most people use powershell as a script.

find, sed, awk, tee are not bash command but *nix tools.
If you're familiar with these tools, it's faster than gui.

Compared that to cmd, where you only got limited command like cd, dir and just other few things.
>>
>>55898427
Well technically speaking you can use unix find, sed, awk tee and the lot with cmd if you want to.
>>
>>55898472
Yeah but the tools doesn't come built-in with windows is one of the reason cmd unpopular.

Personally, rather than focus on powershell i would prefer microsoft improved cmd tools.

You can easily substitute powershell with any other scripting language, like python.
In fact, python are better than powershell.
>>
>>55892916
what does the ' | ' do?
>>
>>55899648
It's a pipe
It redirects output of a program to the input of another one
It's really powerful when you can combine a lot of small programs
>>
>>55899648
Pipe.
"find" will give list of matching files to "parallel".
"parallel" will execute ffmpeg in parallel to convert matched files to flac.
>>
Fish is fucking awesome.
The only thing missing is being able to run bash scripts.
>>
>>55899768
thats really cool. i agree that the command you gave is really hard to top with any programming language

>>55899779
ok so parallel is only used for converting several files at once?

If i were to do this without parallel like this:
find . -name "*.wav" | ffmpeg -i '
{} -c:a flac {.}.flac


would ffmpeg execute the converting command for every .wav file seperately?
>>
>>55895935
Cool, but probably limited in a bunch of strange ways. Maybe some day it'll be better than Cygwin. (I know they work completely differently, I'm just saying Cygwin is probably more useful)
Thread posts: 37
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.