It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
Orkhepaj: hmm , isnt that just simple pipelineing? im pretty sure powershell has it
Maybe. I know MS-DOS had piping too, however the EOF character would kill streams, and null/0 was more or less undefined. In powershell it might be improved, however i doubt very many windows applications use or take advantage of it, rather all exe's must once again be self-contained.
avatar
rtcvb32: Maybe. I know MS-DOS had piping too, however the EOF character would kill streams, and null/0 was more or less undefined. In powershell it might be improved, however i doubt very many windows applications use or take advantage of it, rather all exe's must once again be self-contained.
Having attempted to use Powershell, I can safely say it's no bash. It uses an entirely different syntax and doesn't interact with the filesystem very nicely.
avatar
rtcvb32: Maybe. I know MS-DOS had piping too, however the EOF character would kill streams, and null/0 was more or less undefined. In powershell it might be improved, however i doubt very many windows applications use or take advantage of it, rather all exe's must once again be self-contained.
avatar
Darvond: Having attempted to use Powershell, I can safely say it's no bash. It uses an entirely different syntax and doesn't interact with the filesystem very nicely.
Mhmm... I'll expect Powershell is just a more advanced Batch file processer; While MS-Dos Batch file programming was... weak, and less a fully functional programming language like Bash.
avatar
Darvond: Having attempted to use Powershell, I can safely say it's no bash. It uses an entirely different syntax and doesn't interact with the filesystem very nicely.
avatar
rtcvb32: Mhmm... I'll expect Powershell is just a more advanced Batch file processer; While MS-Dos Batch file programming was... weak, and less a fully functional programming language like Bash.
Bash still is sometimes trickier than it should be.

Here's one task that's more cumbersome than it should be:

Suppose we have a program that can convert a .flac file to an .ogg file, and calling it involves providing both the input and output filename on the command line. What you want to do is convert every .flac file into an .ogg file, with the output files having the same name but with a .ogg extension instead of a .flac one, and in a different directory. To complicate matters, the filenames have spaces in them.

This task I found to be rather cumbersome in bash, even though it feels like it ought to be easy; I ended up using Python for this task when I needed to do so.
avatar
dtgreene: Suppose we have a program that can convert a .flac file to an .ogg file, and calling it involves providing both the input and output filename on the command line. What you want to do is convert every .flac file into an .ogg file, with the output files having the same name but with a .ogg extension instead of a .flac one, and in a different directory. To complicate matters, the filenames have spaces in them.
Hehe, already solved this. A combination rename and find. I tend to do things in bulk so this actually was easy enough...

For bulk file(s) like i do when converting wav to flac for storage (since flac does better) i'd do the following.

find -iname "*.wav" -exec ffmpeg -i {} {}.flac \; &

at this point i'd leave it wav.flac when storing, but assuming flac was the final result i'd then do

find -iname "*.wav.flac" -print0 | xargs -0 -P 8 -n 20 rename .wav.flac .flac

that handles the extention, spaces, conversoin and everything.

Converting wav.flac back to just wav does this little script
find -iname "*.wav.flac" -exec ffmpeg -v 0 -i {} {}.wav \;
find -iname "*.wav.flac" -delete
find -iname "*.wav.flac.wav" -print0 | xargs -0 -P 8 -n 20 rename .wav.flac.wav .wav

Also if you change IFS in Bash to say :, then spaces problem goes away, though you have to have the list built a little differently than usual.

Though supposing you don't want to use find and want to use IFS instead, i did something along these lines.

LIST="`find "$@" -iname "*.png" | <some stuff> | tr "\n" : | sed -E -e "s/:$//;s/([][\$\!])/\\\1/g"`"

IFS=":"
for F in $LIST;

now when $F is used it should be safe even with spaces. that sed thing at the end just does a little cleanup of escaping certain characters and making sure : isn't the last character

edit: It occurs to me you aren't used to spaces in your filenames. Enclosing the filename in quotes will handle that. I started enclosing all incoming arguments and variables in quotes regardless anymore.

Also looking at the above, if you didn't want to use find you could just quote them. So... This should give you similar results if you didn't want to use find.

ffmpeg -i "${F}" "${F}.ogg"
rename .flac.ogg .ogg *.flac.ogg
Post edited September 16, 2021 by rtcvb32
avatar
rtcvb32: -snip-
That's a simple, but awesome, tip, thank you!

--

Some of you said that the best way to learn Linux is to simply, use it. That's what Im doing for four days. Really nice experience.

I've learned many things through 'problems' that emerged and, while some of them were easy to solve, others are harder for me. Here's one:

In one HD I have 5 partitions, two of which I want to dedicate completely to Linux Mint. I installed Linux in partition 5. Partition 4 is completely empty and Im trying to merge it with Partition 5. Here's the problem. "Disks" in Linux Mint wont let me merge 4 with 5. Searching for solutions, I found this:

https://unix.stackexchange.com/questions/509672/how-do-i-merge-two-ext4-partitions

While not exactly my 'problem', it's really similar. Thing is, I have no idea how Im supposed to do what he said.

By the answers, I understood that I can't merge 4 > 5 if the system is installed in 5, I would only be able to merge if 4 was Linux Mint and 5 were empty. Then the upvoted answer is:

@Emanuel Rosa:
"Get the contents of sda8 and add them into sda7.
Delete sda8.
In the unallocated space where sda8 was, create a new Linux swap partition; The same size as the one you already have.
Delete the "old" Linux swap partition, sda6.
That should allow you to drag sda5 and sda7 to the left, freeing up space after sda7. Then you can extend sda7 to consume the remaining free space."

How? What did he meant by "Get the contents of" exactly?
avatar
.Keys: -snip-
This is the wrong approach. You shouldn't be doing anything involving partitioning in a production system. (That is to say, within it.)

Now while there are a lot of strange and arbitrary rules regarding partitioning, there shouldn't be any restrictions on restructuring if you approach them from "orbit", so to speak.

So you'd boot into a live USB, and manage the partitioning (VERY CAREFULLY) from there.
avatar
.Keys: -snip-
avatar
Darvond: This is the wrong approach. You shouldn't be doing anything involving partitioning in a production system. (That is to say, within it.)

Now while there are a lot of strange and arbitrary rules regarding partitioning, there shouldn't be any restrictions on restructuring if you approach them from "orbit", so to speak.

So you'd boot into a live USB, and manage the partitioning (VERY CAREFULLY) from there.
Thank you for the quick answer. Got it. That makes sense.
The system is actually booted in the block of memory from which Im trying to alter it, so it wont let me make any changes, because, well, the system need that block to operate.

So, If I come from outside using an, like you said, "Orbit" boot, therefore, another block of operation, I will be able to 'change everything' from outside, to sum up.

Did I got it right?
avatar
.Keys: Thank you for the quick answer. Got it. That makes sense.
The system is actually booted in the block of memory from which Im trying to alter it, so it wont let me make any changes, because, well, the system need that block to operate.

So, If I come from outside using an, like you said, "Orbit" boot, therefore, another block of operation, I will be able to 'change everything' from outside, to sum up.

Did I got it right?
Basically yes.

None of your drives will be mounted if you use the liveUSB method.
avatar
.Keys:
Partitioning already formated and non-empty disks seem to be way easier in Windows than Linux, probably for a good reason.
In Windows you can move partitions around, shrunk and expand them almost arbitrarily, the limitation seem to be with more than one Operating System installed is not so flexible.

In Linux Mint, it's possible to expand partitions but the proces it's not as a simple "click button" like in Windows. It's been a few years since I've done it but involved having the 2 partitions being merged to be side by side using GParted. They must be unmounted, that's why it's better done from a live USB.

One more tip, sometimes it's easier to search answers for Ubuntu than Linux Mint, both work.
avatar
Darvond: Basically yes.
None of your drives will be mounted if you use the liveUSB method.
Nice, thank you.

avatar
Dark_art_: Partitioning already formated and non-empty disks seem to be way easier in Windows than Linux, probably for a good reason.
In Windows you can move partitions around, shrunk and expand them almost arbitrarily, the limitation seem to be with more than one Operating System installed is not so flexible.

In Linux Mint, it's possible to expand partitions but the proces it's not as a simple "click button" like in Windows. It's been a few years since I've done it but involved having the 2 partitions being merged to be side by side using GParted. They must be unmounted, that's why it's better done from a live USB.

One more tip, sometimes it's easier to search answers for Ubuntu than Linux Mint, both work.
Maybe a safety measure? After all It's easier to 'break' things in Linux than it is in Windows, particularly as a beginner.
Yes, I got used to Windows gui. Thankfully, cli and mint gui are really comfortable to use.
Thank you too for the tip. :)
Yes priorly it is difficult for a window user to shift In Linux, however after that I think user experience is quite positive.
Post edited September 16, 2021 by jackkim123
avatar
jackkim123: Yes priorly it is difficult for a window user to shift In Linux, however after that I think user experience is quite positive.
One interesting question one could ask:
* For someone who has never used Windows or Linux before (and let's assume they haven't used Mac OS, either), which OS would be easier to learn?
avatar
dtgreene: One interesting question one could ask:
* For someone who has never used Windows or Linux before (and let's assume they haven't used Mac OS, either), which OS would be easier to learn?
I think it depends on the person.
Windows to me feels more simplified/streamlined in the usual processes, but if the user wants more control over a process or wants to go deeper in the technical part, at least in my experience, Linux tends to be easier to learn and use. Also, if something breaks on Windows, at least I find it much harder to find a working solution, while the solutions for Linux tend to work, but are far more technical (so there's a bigger learning curve).
And I can't comment on the MacOS because the most recent version I've used so far is the Macintosh 68K.
Post edited September 16, 2021 by _Auster_
avatar
dtgreene: One interesting question one could ask:
* For someone who has never used Windows or Linux before (and let's assume they haven't used Mac OS, either), which OS would be easier to learn?
avatar
_Auster_: I think it depends on the person.
Windows to me feels more simplified/streamlined in the usual processes, but if the user wants more control over a process or wants to go deeper in the technical part, at least in my experience, Linux tends to be easier to learn and use. Also, if something breaks on Windows, at least I find it much harder to find a working solution, while the solutions for Linux tend to work, but are far more technical (so there's a bigger learning curve).
And I can't comment on the MacOS because the most recent version I've used so far is the Macintosh 68K.
Actually, I think it may be easier to tell someone how to do certain tasks on Linux versus Windows.
* Windows: You need to tell the user which buttons and menu options to select, where they are, and all that sort of stuff. Worst case, a registry edit might be needed, and the registry can be tricky to navigate.
* Linux: Just give the user some commands to type, or in some cases, make an edit to a text file. Text files are much easier to deal with than the registry, and typing commands doesn't rely on having to find the command, if someone knows what to type (whereas knowing which menu option to choose isn't enough, as you still need to find that option).