View Single Post

  #3 (permalink)  
Old 04-04-2006, 11:30 PM
monk's Avatar
monk monk is offline
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Quote:
Is it best to wright menu driven script all in one file of link it to different scripts
If linking how do that ?
If your shell script is very big, divide it into function and call function from main script.
function.sh
Code:
function a(){
  echo "I am a()"
}

function b(){
  echo "I am b()"
}
script.sh
Code:
#!/bin/bash
source function.sh
a
b
Quote:
Is there away when a script exits to leave you in the directory the script it self was last in b4 exit instead of returning you back to to dir you where in when you started script.
ie..
start script in \home
script runs and change dir a few time finishing in \home\whatever
script exits and your shell returns prompt back in \home
how do get prompt back so you are still in \home\whatever
Sorry but I’m not really getting your point… could you more specific?
Reply With Quote