Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 15 Sep 2014, 05:33
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Issue writing a function... !
Post new topic   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
vnairaj

Joined: 10 Feb 2014
Posts: 2

PostPosted: Mon 10 Feb 2014, 12:19    Post subject:  Issue writing a function... !
Subject description: Code in a function
 

Hello all..
I have return a script which is needed to return a value if it is successfully completed.

my code is :


#!/bin/bash

echo "enter the source path for file1 with file extension"
read source1

echo "enter file1 name with extension"
read file1


echo "enter the source path for file2 with file extension"
read source2

echo "enter file2 name with extension"
read file2

echo "Target location : "
read target

echo $file1 "started copying...."

cp $source1 $target

echo "$file1 is copied to target location successfully \n"

echo "$file2 started copying...."
cp $source2 $target

cd $target
echo "$file1 started uncompressing.."
gunzip $file1

echo "$file1 uncompressed successfully"

echo "$file2 started uncompressing.."
gunzip $file2

echo "Files unzipped"


It need to return a value 0 ..
If everything is executed properly.. All the things are executing properly but am nt able to put it in a function..


can you please put it into a function ..
please help... !
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11062
Location: Arizona USA

PostPosted: Mon 10 Feb 2014, 14:52    Post subject:  

Please don't post the same question several places in the forum. Thanks. Smile (I moved them both to the Programming section.)
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0366s ][ Queries: 11 (0.0030s) ][ GZIP on ]