I'm trying to transform a bash script to python, and I have a piece of code that I want to understands better. The script:
dd < "$file" skip=$start count=$((end - start)) iflag=skip_bytes 2> /dev/null |
(
if [ -n "$dir" ]; then
mkdir -p -- "$dir/$subdir"
cd -- "$dir/$subdir"
fi
cpio -i "$@"
)
My understanding is that I read from a file I junk over "$start" bytes and go further count
bytes.
So I presume I can do this with seek
.
How do I translate iflag=skip_bytes
to python ?
iflag=skip_bytes
to python ?" You already did if you interpretskip
as bytes. It would be blocks otherwise.iflag
parameter for BSDdd
, for example.