Sponsored Content
Top Forums Shell Programming and Scripting nested double quota and white space inside variable Post 302422274 by lindazhou on Tuesday 18th of May 2010 02:50:02 AM
Old 05-18-2010
nested double quota and white space inside variable

I have a question about nested double quotes. Any help is appreciated.

Here are my commands on Mac OS.
# string="Ethernet \"USB Ethernet\" \"Bluetooth DUN\" AirPort FireWire \"Bluetooth PAN\""
# echo $string
Ethernet "USB Ethernet" "Bluetooth DUN" AirPort FireWire "Bluetooth PAN"
# networksetup -ordernetworkservices $string - This gives error.
The networksetup command requires quote around service name that has space in it.
But when shell expands the $string that has nested quotes, it treats the string that has quote around it as two separate words. In this case, "USB Ethernet" becomes 'USB' 'Ethernet'. What I really want is "USB Ethernet".
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

stripping white space...

Hi All; Having a problem with a file.. the file contains the following data... (a snapshot) 1331F9E9DB7C2BB80EAEDE3A8F043B94,AL7 1DZ,M,50 186FDF93E1303DBA217279EC3671EA91,NG5 1JU,M,24 3783FFAF602015056A8CD21104B1AAAF,CH42 4NQ,M,17 It has 3 columns sepreated by a , the second column... (7 Replies)
Discussion started by: Zak
7 Replies

2. UNIX for Dummies Questions & Answers

SED with White Space

Dear Members, Suppose i have a variable test which stores a string as below: test='John drives+++++++++a+++++car' now i want to use sed on the above variable and replace + with a white space, so that i get echo $test should give me 'john drives a car' Between... (1 Reply)
Discussion started by: sandeep_1105
1 Replies

3. Shell Programming and Scripting

sed + white space

Hi, What sed command (if sed is the right command) can remove ALL white space from my file. I have a csv, except I want to remove all white space between commas and characters. My idea (without testing) sed 's/ //g' Is there a better way? (18 Replies)
Discussion started by: mcclunyboy
18 Replies

4. Shell Programming and Scripting

awk: Eliminating white space while setting variable

Hi, I have a large flat file from host without delimiter. I'm transforming this file to a csv file using statements like # Row 03: Customer / field position 3059 +20 WOFABNAM=substr( $0, 3059, 20 ); and deleting the trailing whitespaces before and after with that sub( /^ +/, "",... (4 Replies)
Discussion started by: Celald
4 Replies

5. UNIX for Dummies Questions & Answers

filename with white space

our user creates a text file with a white space on the filename. this same file is transfered to unix via automation tool. i have a korn shell script that reads these files on a input directory and connects to oracle database to run the oracle procedures which will load the data from each of the... (2 Replies)
Discussion started by: wtolentino
2 Replies

6. Shell Programming and Scripting

Nested case inside awk

please let me know if the below code could be written efficiently inside single awk case "$INP" in ksh) cat catalog | awk 'BEGIN {FS=",";} { print $2 } END {}' ;; pset) cat catalog | awk 'BEGIN {FS=",";} { print $3 } END {}' ;; dml) cat catalog | awk 'BEGIN {FS=",";} {... (2 Replies)
Discussion started by: cvsanthosh
2 Replies

7. Shell Programming and Scripting

awk - trim white space from a field / variable

Hi, Consider the data (FS = |): 1| England |end 2| New Zealand |end 3|Australia|end 4| Some Made Up Country |end 5| West Indies|end I want the output to be (i.e. without the leading and trailing white space from $2) England New Zealand Australia Some Made Up Country West... (4 Replies)
Discussion started by: Storms
4 Replies

8. HP-UX

Unable to pass a space inside a variable shell scripting

Can anyone help me in solving this ? p=`date` e=`echo $p | awk '{print $2,$3}'` # echo $p Wed Aug 4 12:00:08 IST 2013 but when I am echoing the value of e it is giving me with one space. As shown below: # echo $e Aug 4 I need this value to be exact as found in... (6 Replies)
Discussion started by: Kits
6 Replies

9. Shell Programming and Scripting

Add white space

hi guys how can i add spacein file name with sed if strings have no space around dash input 19-20 ( 18-19 ) ABC-EFG output after add white space 19 - 20 (18 - 19 ) ABC - EFG thx in advance (2 Replies)
Discussion started by: mhs
2 Replies

10. Shell Programming and Scripting

Error with nested if within an sqlplus task inside

Hi ALL, I am receving a "strange" error using a nested if within an sql operation inside: ./dom.ksh: syntax error at line 80 : `then' unmatched This is all my script code: in bold the step receiving the error. Any help would really aprrecieted ......! **** I have tried all the... (2 Replies)
Discussion started by: AndreaCecco
2 Replies
SMSC(4) 						   BSD Kernel Interfaces Manual 						   SMSC(4)

NAME
smsc -- USB SMSC LAN9xxx Fast Ethernet driver SYNOPSIS
To load the driver as a module at boot time, place the following line in loader.conf(5): if_smsc_load="YES" Alternatively, to compile this driver into the kernel, place the following lines in your kernel configuration file: device uhci device ohci device usb device miibus device smsc DESCRIPTION
The smsc device driver provides support for USB Fast Ethernet adapters based on the SMSC LAN9xxx chipsets. For more information on configuring this device, see ifconfig(8). HARDWARE
The following devices are supported by the smsc driver: o SMSC LAN9500, LAN9500A, LAN9505 and LAN9505A based Ethernet adapters o SMSC LAN89530, LAN9530 and LAN9730 based Ethernet adapters o SMSC LAN951x Ethernet adapters with integrated USB hub SEE ALSO
arp(4), intro(4), miibus(4), netintro(4), usb(4), ifconfig(8) HISTORY
The smsc device driver first appeared in FreeBSD 10.0. AUTHORS
The smsc driver was written by Ben Gray <bgray@FreeBSD.org>. BSD
September 26, 2014 BSD
All times are GMT -4. The time now is 07:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy