The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with a question i have attempted to figure out Vn3050 UNIX for Dummies Questions & Answers 0 03-05-2007 07:57 PM
Can't figure out else not matching peteroc Shell Programming and Scripting 4 09-19-2006 04:58 PM
figure it out cool_dude UNIX for Dummies Questions & Answers 1 09-11-2006 12:49 PM
i can not figure this out steph UNIX for Dummies Questions & Answers 1 08-21-2002 08:32 AM
how to figure out the size in MB for an informix database Optimus_P UNIX for Advanced & Expert Users 5 09-07-2001 09:32 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-25-2007
Stud33 Stud33 is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 16
Cant figure out this..

Hi, I need a little help here. I am exporting user info from a PSQL database and everything is working with the exception of this:

10029008:dsAuthMethodStandard\:dsAuthClearText:classword:10029008:2004:10029008:10029008:/home/student/1002/90/08:10029008

It is putting a colon right before the last numbers. I need to have a / to complete the home path. Any suggestions are welcome and I appreciate this forums help.


Thanks,
JW
  #2 (permalink)  
Old 10-25-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Here is an attempt....

Code:
#!/bin/sh

first()
{
        echo $1
}

second()
{
        echo $2
}

handle_b()
{
        IFS=":"
        export IFS
        echo $@ | while read X Y
        do
                echo $X $Y
        done
}

IFS=":"
export IFS
while read A B C D E F G H I J K L M N O P Q
do
        (
                IFS=" "
                B1=`handle_b $B`
                B2=`first $B1`
                B3=`second $B1`
                echo $A\:$B2\\:$B3\:$C\:$D\:$E\:$F\:$G\:$H/$I
        )
done
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:05 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0