Microsoft
Software
Hardware
Network
Question : parsing a string using Shell script
How do I parse a string and retrieve the last 3 digits and add 4 to the start of the 3 digits
the string could be in following formats:
customer100
cust100
I need to retrieve the last 3 digits and add 4 to that. i.e 4100 in shell script. Please advise.
Answer : parsing a string using Shell script
1: 2: 3:
#!/bin/ksh string='customer100' echo 4${string##[a-z]*[a-z]}
Open in New Window
Select All
Random Solutions
array, init, qw - how to include empty string
What's netmask ?
Filter Report Based On Multiple Dynamic Combo boxes
Google earth unable to identify graphics card
2 Linux Machines, 2 setups, whats the difference?
Powershell Script script cannot fit the colums into the display and were removed
Need to query and change the format output of a date column. Currently comming out as yyyy-mm-dd : 00:00:00.000
Printing with TCP/IP with HP Jet Direct
Probs RDPing onto vista after installing VMware
OWA 2000 Some Users Get HTTP 403 Forbidden Error