Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

grep syntax Debian 9

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
Leo195
Posts: 1
Joined: 2019-01-12 06:14

grep syntax Debian 9

#1 Post by Leo195 »

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

Post Reply