06-15-2006
sourcing a file
NORM,
. file
is known as sourcing a file.
It will pull any env settings, or variables set within the file into the current shell.
[ Normal behaviour is for a child process to inherit from a parent, not the other way around, which is why you lost your settings previously]
steve
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
I am trying to execute the below shell script: script name(ss1).
ss1 was given permission - 744 before executing.
name: ss1
#ss1
#usage:ss1
ls
who
pwd
:wq
I tried to execute $ss1 (Enter)
Its not executing.... It says that ss1 is not found:
echo $SHELL. The o/put i got is... (5 Replies)
Discussion started by: dreams5617
5 Replies
2. UNIX for Dummies Questions & Answers
I am trying to run a shell script using the ./<ScriptName> command, but the server returns an error bash: ./Script1.sh: Permission denied
What variable do I need to set to avoid this? (4 Replies)
Discussion started by: igandu
4 Replies
3. UNIX for Advanced & Expert Users
Hi frnds...
I m facing very irritating problem already waisted my 2 days..
I have a following script..( i am pasting only the main code)
ftp -ivn 213.194.40.77 <<FTP
user $user $password
binary
cd $FileDir/out
lcd $localpath
get $file
rename $FileDir/out/$file $FileDir/tmp/$file... (1 Reply)
Discussion started by: clx
1 Replies
4. Shell Programming and Scripting
Hi,
I have a shell script as below:
ORACLE_HOME=/usr/local/opt/oracle/product/dev
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/usr/bin
export PATH
OUTFILE=/export/home/`basename $0`.out
export OUTFILE
export IDEN
df -k . | tail -1 | read a b c d e f
echo $a >> $OUTFILE
echo $b... (4 Replies)
Discussion started by: Abhinav Pandey
4 Replies
5. Shell Programming and Scripting
Hi have a script which transferers from Microsoft server to Linux box.
The scripts(ksh) is on Linux box.
If I run script from terminal, it transfers files to directory. Where as If
I run script from CRON. It does not.
Here is the log of both:
Terminal execution log:... (2 Replies)
Discussion started by: dipeshvshah
2 Replies
6. UNIX for Dummies Questions & Answers
I'm trying to learn how to use cron for repetative tasks. I have an external disk that needs to be unmounted and remounted every hour due to some problems that a backup utility (specifically, TimeMachine) is having repeatedly accessing the device. I've created a shell script that will find the... (3 Replies)
Discussion started by: illuminate
3 Replies
7. Shell Programming and Scripting
Hi,
I created a script which connects to database and update a table.
This script is running fine when i run it manually but when i am trying to execute it scheduling in crontab.script is executing but Data is not getting updated.
below is my script
sqlplus test/##### >> test_feed.log <<!... (6 Replies)
Discussion started by: sv0081493
6 Replies
8. Shell Programming and Scripting
I am facing this weird issue where the script is working fine from the command line but when I am executing it from cron though it is working fine but the "if" loop is processing else part though I know that the if part of the logic is true and ideally the loop should execute the if portion.
... (3 Replies)
Discussion started by: sk2code
3 Replies
9. Shell Programming and Scripting
Hello All,
I'm having an issue getting an expect script to run as a cron job. The script executes fin if I run it from the command line but I get nothing when trying to run it as a cron job. I've researched other forums and threads and there have been references to the environment, or lack... (16 Replies)
Discussion started by: KingT617
16 Replies
10. AIX
Hi,
I have a shell script which fetches the MRP status and the LAG status.
When I execute it manually like, sh <script_name>, it fetches the output as expected, but when I schedule through crontab, it's not working as expected.
Any help would be really appreciated.
Here is the code... (3 Replies)
Discussion started by: Nagaraj R
3 Replies
FORK(2) System Calls Manual FORK(2)
NAME
fork, rfork - manipulate process resources
SYNOPSIS
#include <u.h>
#include <libc.h>
int fork(void)
int rfork(int flags)
DESCRIPTION
Forking is the only way new processes are created. The flags argument to rfork selects which resources of the invoking process (parent)
are shared by the new process (child) or initialized to their default values. The resources include the file name space, the open file
descriptor table (which, when shared, permits processes to open and close files for other processes), the set of environment variables (see
env(3)), the note group (the set of processes that receive notes written to a member's notepg file; see proc(3)), and open files. Flags is
the logical OR of some subset of
RFPROC If set a new process is created; otherwise changes affect the current process.
RFNOWAIT
If set, the child process will be dissociated from the parent. Upon exit the child will leave no Waitmsg (see wait(2)) for the par-
ent to collect.
RFNAMEG
If set, the new process inherits a copy of the parent's name space; otherwise the new process shares the parent's name space. The
tag space for rendezvous(2) is considered part of the name space. Is mutually exclusive with RFCNAMEG.
RFCNAMEG
If set, the new process starts with a clean name space. A new name space must be built from a mount of an open file descriptor. Is
mutually exclusive with RFNAMEG.
RFENVG If set, the environment variables are copied; otherwise the two processes share environment variables. Is mutually exclusive with
RFCENVG.
RFCENVG
If set, the new process starts with an empty environment. Is mutually exclusive with RFENVG.
RFNOTEG
Each process is a member of a group of processes that all receive notes when a note is written to any of their notepg files (see
proc(3)). The group of a new process is by default the same as its parent, but if RFNOTEG is set (regardless of RFPROC), the
process becomes the first in a new group, isolated from previous processes.
RFFDG If set, the invoker's file descriptor table (see intro(2)) is copied; otherwise the two processes share a single table.
RFCFDG If set, the new process starts with a clean file descriptor table. Is mutually exclusive with RFFDG.
RFMEM If set, the kernel will mark segments of type data and bss as shared. The child will then inherit all the shared segments the parent
process owns. Other segment types will be unaffected. Subsequent forks by the parent will then propagate the shared data and bss
between children. The stack segment is always split. May be set only with RFPROC.
File descriptors in a shared file descriptor table are kept open until either they are explicitly closed or all processes sharing the table
exit.
If RFPROC is set, the value returned in the parent process is the process id of the child process; the value returned in the child is zero.
Without RFPROC, the return value is zero. Process ids range from 1 to the maximum integer (int) value. Rfork will sleep, if necessary,
until required process resources are available.
Fork is just a call of rfork(RFFDG|RFPROC).
SOURCE
/sys/src/libc/9syscall
/sys/src/libc/9sys/fork.c
SEE ALSO
intro(2), proc(3),
DIAGNOSTICS
These functions set errstr.
FORK(2)