The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's manas6 UNIX for Dummies Questions & Answers 0 06-05-2008 03:44 AM
deleting 'carriage return' from string viko Shell Programming and Scripting 6 03-13-2008 04:08 AM
String search and return value from column jaydeep_sadaria Shell Programming and Scripting 3 01-12-2008 12:31 AM
return line below string grepp'ed for hcclnoodles Shell Programming and Scripting 2 01-30-2007 01:45 AM
Regarding functions sendhilmani Shell Programming and Scripting 2 03-24-2006 12:40 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2008
Read Only
 

Join Date: Apr 2008
Posts: 40
Stumble this Post!
Arrow return string in functions

Hi friends

I need to return string value in functions
can anyone help me out to return string values rather than integer.

#!/bin/bash
add_a_user()
{
USER=$1
COMPANY=$2
shift; shift;
echo "Adding user $USER ..."
echo "$USER working in $COMPANY ..."
ret_type=YES
return $ret_type
}
echo "Start of script..."
add_a_user kittu Google
echo "End of script..."

i need your valuable suggesions please.
Thanks
Kittu
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-15-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
Stumble this Post!
Print them and call the function in backticks. Return codes from functions and programs are small integers 0-255.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0