skip to Main Content

Ubuntu – Can't index of the "#[hello]" in bash

The following index_of function doesn't work for all cases: #!/bin/bash index_of() { local string="$1" local search_string="$2" local prefix=${string/${search_string}*/} local index=${#prefix} if [[ index -eq ${#string} ]]; then index=-1 fi printf "%s" "$index" } a='#[hello] world' b=$(index_of "$a" "world") echo "A:…

VIEW QUESTION

esp32 flahing from ubuntu

I am trying to get esp-idf working with ubuntu. I see the usb tty port in /dev, as /dev/ttyUSB0. Compilation of my blink program happened without any issues, in ubuntu, but when I tried to flash the image to esp32,…

VIEW QUESTION
Back To Top
Search