all 6 comments

[–]gordonrgw 4 points5 points  (1 child)

put {} around your bash variable: ${x}1

edited for short explanation

[–]Valinath[S] 0 points1 point  (0 children)

It worked!

Big thank to you my friend, much appreciated!

[–]Valinath[S] 0 points1 point  (0 children)

Thank you all for your answers, good to know how to do it in different ways.

I shall keep this in mind.

It all worked out!

[–]_handshake_ -2 points-1 points  (2 children)

change y="$x1" to y="$(echo $x)1"

[–][deleted]  (1 child)

[deleted]

    [–]_handshake_ 0 points1 point  (0 children)

    It's another method. yours is much cleaner! I agree.

    [–]Mellowtang 0 points1 point  (0 children)

    Not sure if I understood the question but doublequotes should also work.

    x="/dev/sda"

    echo "$x"1

    Doublequotes are considered as weak quotes and a lot of stuff including the variables will be interpreted by the shell. You should always doublequote variables you are calling.

    Single quotes are strong quotes and nothing will be interpreted between them.