Search Results

Search: Posts Made By: humkhn
2,282
Posted By ctsgnb
sed 's|:[^:]*:[^:]*$||' infileor # echo...
sed 's|:[^:]*:[^:]*$||' infileor

# echo "John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638:9/3/90:45900" | sed 's|:[^:]*:[^:]*$||'
John Carey:507-699-5368:29 Albert way, Edmonton, AL...
2,282
Posted By anbu23
4 echo "John Carey:507-699-5368:29 Albert way,...
4 echo "John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638:9/3/90:45900" | sed "s/\(.*\):[^:]*:[^:]*$/\1/"
John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638
3,653
Posted By Scrutinizer
Here is another (without a trim): xmltag(){ ...
Here is another (without a trim):
xmltag(){
printf "<%s>%s</%s>\n" "$1" "$2" "$1"
}

while IFS=: read name phone addr dob sal
do
printf "<STUDENTS>\n"
xmltag NAME "$name"
xmltag...
3,653
Posted By fpmurphy
Here is one way of doing it: #!/bin/bash ...
Here is one way of doing it:

#!/bin/bash

trim()
{
trimmed=${1}
trimmed=${trimmed%% }
trimmed=${trimmed## }

echo ${trimmed}
}


IFS=":"

echo "<STUDENTS>"
while...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 12:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy