grep syntax Debian 9

Everything about X, Gnome, KDE, ... and everything running on it

grep syntax Debian 9

Postby Leo195 » 2019-01-12 06:20

some of you already helped me out with the right usage of grep within a bashscript

Code: Select all
get_img=$( grep -Po '(?<= Poster" src=")[^"]*' <<< $IMDBBTMP )


this works like a charm since I've ported the hole script to an fresh Debian 9 System.

$get_img still remains empty, $IMDBBTMP will be filled as well.

I show you the whole Code that works on an older Debian Install very well

Code: Select all
getLine() {
        index=0; while ((index<${#IMDBB[@]})); do
        if [[ ${IMDBB[$index]} = *"imdb"* ]]; then
                idx=$index; return
        fi
        ((index++)); done
        echo 'Not Found'; return 1
}
        IMDBB=(`grep imdb $TXT`)
        if [ $IMDBB ]; then
                getLine
                LINK=${IMDBB[$idx]}
                echo $LINK
                IMDBBTMP=$( curl -L ${LINK} )
                echo $IMDBBTMP
                get_img=$( grep -Po '(?<= Poster" src=")[^"]*' <<< $IMDBBTMP )
                echo $get_img
                PICWORK=${get_img//[\"\'\=\<\> ]/}
                echo $PICWORK
                PICWORK=$(echo $PICWORK | sed 's/linkrelimage_srchref//g')
                echo $PICWORK
                EXTENSION="${PICWORK##*.}"
                wget -O $FILENAME.$EXTENSION $PICWORK > /dev/null 2>&1
                PICTURE="$PICTUREPATH/$FILENAME.$EXTENSION"
                echo $PICTURE
        fi
Leo195
 
Posts: 1
Joined: 2019-01-12 06:14

Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable