Skip to content

Commit 8a6bd70

Browse files
committedFeb 24, 2014
remove line-ending blanks
cleanup
1 parent 3fe3192 commit 8a6bd70

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed
 

‎lsusb

+9-9
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ parse () {
4848

4949
# Get the bus number. It's the first two hex digits of the Location ID.
5050
# We'll convert to decimal later
51-
bus_num=`echo "$location" | sed -e 's/^..\(..\).*/\1/;'`
51+
bus_num=`echo "$location" | sed -e 's/^..\(..\).*/\1/;'`
5252

5353
# Get the device number. It's after the '/' in the Location ID, already decimal.
5454
device_num=`echo "$location" | awk -F'/' '{print $2}'`
@@ -110,7 +110,7 @@ parse () {
110110
# Filter by VID/PID if given as input argument.
111111
if [ -n "$vid_pid" ]; then
112112
# Convert input vid to lower case.
113-
if [ -n "$(echo "$vid_pid" | egrep ':')" ]; then
113+
if [ -n "$(echo "$vid_pid" | egrep ':')" ]; then
114114
arg_vid=`echo "$vid_pid" | awk -F':' '{print $1}' | sed 's/^0x//' | tr '[A-Z]' '[a-z]'`
115115
if [ -n "$arg_vid" ]; then
116116
if [ $((16#$arg_vid)) -ne $((16#$VID)) ]; then
@@ -125,14 +125,14 @@ parse () {
125125
fi
126126
else
127127
# Missing a colon is a syntax error in -d option
128-
help
128+
help
129129
exit 1
130130
fi
131131
fi
132132

133133
# Filter by BUS/DEV if given as input argument.
134134
if [ -n "$bus_dev" ]; then
135-
if [ -n "$(echo "$bus_dev" | egrep ':')" ]; then
135+
if [ -n "$(echo "$bus_dev" | egrep ':')" ]; then
136136
# Convert input bus to lower case
137137
arg_bus=`echo "$bus_dev" | awk -F':' '{print $1}' | sed 's/^ *//; s/ *$//'`
138138
if [ -n "$arg_bus" ]; then
@@ -150,7 +150,7 @@ parse () {
150150
fi
151151
fi
152152
# Special case: no colon after -s means device-only.
153-
if [ -z "$(echo "$bus_dev" | egrep ':')" ]; then
153+
if [ -z "$(echo "$bus_dev" | egrep ':')" ]; then
154154
# Strip leading and trailing spaces from argument.
155155
arg_dev=`echo "$bus_dev" | sed 's/^ *//; s/ *$//'`
156156
if [ -n "$arg_dev" ]; then
@@ -193,7 +193,7 @@ buildtreeline () {
193193
# bb -- bus number in hexadecimal
194194
# dddddd -- up to six levels for the tree, each digit represents its
195195
# position on that level
196-
#
196+
#
197197
# So we start each line with the LocationID for sorting purposes, then append the rest of the line as we want it
198198
# Later, we'll do the sort, then strip off the LocationID for display purposes
199199

@@ -229,9 +229,9 @@ tree () {
229229
treedata="${treedata}""${treeline}"$'\n'
230230
done
231231

232-
# Strip off final \n.
232+
# Strip off final \n.
233233
treedata=`echo "${treedata}" | awk '{ prev_line = line; line = $0; } NR > 1 { print prev_line; } END { ORS = ""; print line; }'`
234-
234+
235235
# Sort by Location ID.
236236
treedata=`echo "${treedata}" | sort`
237237

@@ -245,7 +245,7 @@ tree () {
245245
cleanup
246246

247247
# Not really needed, as cleanup routine does the exit.
248-
exit 0
248+
exit 0
249249
}
250250

251251
# Parse options

0 commit comments

Comments
 (0)
Please sign in to comment.