Shell string stitching

test.sh

#!/bin/bash

your_name
="runoob"
# Use double quotes to splice
greeting
="hello, "$your_name" !"
greeting_1
="hello, ${your_name} ! "
echo $greeting $greeting_1
# Use single quotes to splice
greeting_2
='hello, '$your_name' !'
greeting_3
='hello, ${your_name} ! '
echo $greeting_2 $greeting_3

Output

bogon:Desktop macname$ ./test.sh

hello, runoob
! hello, runoob !
hello, runoob
! hello, ${your_name} !

#!/bin/bash

your_name
="runoob"
# Use double quotes to splice
greeting
="hello, "$your_name" !"
greeting_1
="hello, ${your_name} ! "
echo $greeting $greeting_1
# Use single quotes to splice
greeting_2
='hello, '$your_name' !'
greeting_3
='hello, ${your_name} ! '
echo $greeting_2 $greeting_3

bogon:Desktop macname$ ./test.sh

hello, runoob
! hello, runoob !
hello, runoob
! hello, ${your_name} !

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5500 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.