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 Sun 31 Aug 2014, 00:40
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Issue writing a function... !
Post_new_topic   Topic_locked View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
vnairaj

Joined: 10 Feb 2014
Posts: 2

PostPosted: Mon 10 Feb 2014, 12:19    Post_subject:  Issue writing a function... !
Sub_title: 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: 11031
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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Topic_locked View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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