4 ms·
People like shell scripts because you have one interface: text For example: you need to write an image to a USB stick. Python: pretty lengthy BASH: image > /de
by throwaway747271 4y ago
People like shell scripts because you have one interface: text
For example: you need to write an image to a USB stick.
Python: pretty lengthy
BASH: image > /dev/SDA
Both will do exactly the same, but one is a few lines of python the other just one line in bash.
- hn92726819 4y agoWhy a throwaway for this? Is this a gpt response? Also it's not right. You need to do something like image.img <cat> /dev/sda
- all2 4y agodd if=<image> of=<output device> bs=<block size> I use this whenever I need to bake an image to a USB stick.
- throwaway362651 4y agoAlways append status=progress and conv=fdatasync Makes sure that the buffer is flushed to disk before finishing.
- hn92726819 4y agoOf course. That's the right way to do it. I was pointing out that what was written isn't right in any situation and the smallest change to make it make sense would be adding <cat> in the middle Turns out my answer was wrong too :D. Should have been <image.img cat >/dev/sda. Oh well
- throwaway362651 4y agoWhy a throwaway? I am on my phone with no access to my real password. Don't get bothered by it?! Did this look like a proper bash command to you?! Maybe that was some runable python code?! File ending has nothing to do with its contents. Image.img could be an mp3. Stop hairsplitting.
- hn92726819 4y agoNot upset but I am touchy about gpt results. The ending wasn't the key part, the <cat> was the key part. I added img because that's the only image type I can think of that makes sense to write to sda in that way. Why would anyone write an mp3 to a block device bit by bit