Convert echo to printf in scripts
authorGeoff Levand <geoff@infradead.org>
Tue, 16 Oct 2012 21:58:53 +0000 (14:58 -0700)
committerGeoff Levand <geoff@infradead.org>
Tue, 16 Oct 2012 21:58:53 +0000 (14:58 -0700)
Signed-off-by: Geoff Levand <geoff@infradead.org>
utils/pb-event.c
utils/pb-udhcpc

index a119e21b24622545f99b3648510c36bcaac3dd7c..1a3cd3b0de240b403e0b12c5399e8cecfb879e28 100644 (file)
@@ -59,8 +59,8 @@ static void print_usage(void)
 "\n"
 "Examples:\n"
 "\n"
 "\n"
 "Examples:\n"
 "\n"
-"       echo -ne 'add@/net/eth0\\0name=netboot\\0image=tftp://192.168.1.10/vmlinux\\0args=root=/dev/nfs nfsroot=192.168.1.10:/target\\0' | pb-event\n"
-"       echo -ne 'remove@/net/eth0\\0' | pb-event\n"
+"       printf 'add@/net/eth0\\0name=netboot\\0image=tftp://192.168.1.10/vmlinux\\0args=root=/dev/nfs nfsroot=192.168.1.10:/target\\0' | pb-event\n"
+"       printf 'remove@/net/eth0\\0' | pb-event\n"
 "\n");
 }
 
 "\n");
 }
 
index f15706431ee0e692a6a366ea2cc2131e7e10fdb0..45c801909f3a72c62dbf0c80cea434b0ce76c74d 100644 (file)
@@ -15,11 +15,11 @@ pb_add () {
 
        [ ${k_server_ip} != ${rootpath} ] || k_server_ip=${serverid}
 
 
        [ ${k_server_ip} != ${rootpath} ] || k_server_ip=${serverid}
 
-       echo -ne "add@/net/${interface}\0name=netboot\0image=tftp://${siaddr}${boot_file}\0args=root=/dev/nfs ip=any nfsroot=${k_server_ip}:${k_root_dir}\0" | pb-event
+       printf "add@/net/${interface}\0name=netboot\0image=tftp://${siaddr}${boot_file}\0args=root=/dev/nfs ip=any nfsroot=${k_server_ip}:${k_root_dir}\0" | pb-event
 }
 
 pb_remove () {
 }
 
 pb_remove () {
-       echo -ne "remove@/net/${interface}\0name=netboot\0" | pb-event
+       printf "remove@/net/${interface}\0name=netboot\0" | pb-event
 }
 
 case "$1" in
 }
 
 case "$1" in
@@ -33,6 +33,6 @@ deconfig)
        ;;
 esac
 
        ;;
 esac
 
-echo "--- $1 ---" >> ${log}
+printf "--- $1 ---\n" >> ${log}
 set >> ${log}
 set >> ${log}
-echo "---------------" >> ${log}
+printf "---------------\n" >> ${log}