Damn!
Debian “derived” versions of busybox don’t have vi / vim - e.g. you’re FORCED at gunpoint , in a rescue session, to use nano instead (e.g. to comment out a dodgy mount in /etc/fstab, or foobar’d GRUB entry or whatever - frankly I’d rather grapple with the vagaries of regex in sed than use nano).
And - I’m going to assume MobaXterm’s shittyness of foisting essential commands like “cat” on users via the busybox version (that DOES NOT have the display line numbers feature (e.g. “cat -n textfile”)), maybe also comes from Debian’s more sucky (Red Hat busybox has vi!) version of busybox.
MobaXterm… I paid for this SHIT and they expect me to use the hamstrung busybox version of “cat”?
I just googled (yes I use google) for workarounds, and there doesn’t seem to be any, i.e. to
cat -n filename
(to display line numbers at the start of each line)… I guess I need to now write an EFFING for loop and increment it on each iteration of cat for the given filename?
export SEED=1 ; for SHIT in $(cat filename) ; do echo $SEED $SHIT ; SEED=$((SEED+1)) ; done
Look at this UGLINESS :
09/01/2023 10:50.40 /home/mobaxterm cat --help
BusyBox v1.22.1 (2015-11-10 11:07:12 ) multi-call binary.
Usage: cat [FILE]...
Concatenate FILEs and print them to stdout
That’s it - there are NO arguments or command line switches! FU busybox!
What a bunch of wankers at MobaTek - couldn’t they chuck in the proper GNU “cat” command instead? The product I paid for is “MobaXterm Professional” - my arse professional…
One of these days I’m gonna give up on it and try and do cygwin myself, from scratch…
Here’s what I’m trying to do - cat a CSV file and prefex each line in the output, with a number, the filename is : “shonky-shit-show-sheet.csv”
Ordinarily :
cat -n shonky-shit-show-sheet.csv
would work - but NOT with busybox - instead I have to :
export IFS=$(echo -en "\n\b") ; export SEED=1 ; for SHIT in $(cat shonky-shit-show-sheet.csv) ; do echo $SEED $SHIT ; SEED=$((SEED+1)) ; done
How EFFING cumbersome is that?
Yeah - I like to swear, a lot - and I just realised that’s quite a tongue twister, she sells seashells etc…