Sponsored Content
Full Discussion: Bash & Ksh
Top Forums Shell Programming and Scripting Bash & Ksh Post 302347059 by Smiling Dragon on Monday 24th of August 2009 07:59:28 PM
Old 08-24-2009
A script isn't going to modify the environment of the parent process - that would make no sense... Is that what you are trying to do?

If so, you need to call it without forking (ie via the . a.sh like you have above).
You can certainly do this inside a script without problems - it's a very common way of putting configuration items used by several scripts in a central file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Exactly How can we define "sh ksh csh &bash"

Hi - I m prashant. I m new in UNIX&LINUX world. I want to ask that how can we define the shell in Linux like bash,ksh,csh in Linux. What is the use of these shells. I know there are mny experts on net if you can tell me then please do me this favour and tell me about this topic. ... (1 Reply)
Discussion started by: prashantsingh
1 Replies

2. Shell Programming and Scripting

bash and ksh: variable lost in loop in bash?

Hi, I use AIX (ksh) and Linux (bash) servers. I'm trying to do scripts to will run in both ksh and bash, and most of the time it works. But this time I don't get it in bash (I'm more familar in ksh). The goal of my script if to read a "config file" (like "ini" file), and make various report.... (2 Replies)
Discussion started by: estienne
2 Replies

3. UNIX for Advanced & Expert Users

echo in ksh sh & bash

Hello, I have lib file which contain a function that get text to print on screen by echo command. Several scripts are inculde this lib and use this function. Each one of them is written in different shell language (sh ksh & bash). This causing some issues when using backslash charater as... (4 Replies)
Discussion started by: Alalush
4 Replies

4. Shell Programming and Scripting

bash & Ksh loop problem

hi i was trying to optimize one script and i came across this problem .. i am putting some pseudo code here $ >cat a.sh ls | while read I do i=$(($i + 1)) done echo "total no of files : " $ >ksh a.sh total no of files : $ >bash a.sh total no of files : why is... (1 Reply)
Discussion started by: zedex
1 Replies

5. UNIX for Dummies Questions & Answers

bash preferred or ksh with bash features

I'm a user on a fairly locked down sys V server. By default, I have ksh set as my default shell. I added to my .profile: bash -o vi so when I login, it goes into bash so I can take advantage of tab completion and use the up key to bring up previous commands. However, whenever I want to exit, I... (2 Replies)
Discussion started by: mrwatkin
2 Replies

6. Shell Programming and Scripting

Bash & Ksh

I am using a Linux machine and it's default shell is BASH . I have korn shell script and inside it's setting environment variables. But after execuitng the script those env values are not holding the values . If I run the script outside of that ksh script with source a.sh , it's able to hold to... (2 Replies)
Discussion started by: talashil
2 Replies

7. Shell Programming and Scripting

combination between || and && in IF condition with ksh

Dear All, Please advice about this issue. when i run this line in a script if && || && || && if i enter $x = test3 and $y = test1 the If condition apply while it should not Best Regards (2 Replies)
Discussion started by: islam.said
2 Replies

8. Shell Programming and Scripting

ksh equivalent to >& in csh

In csh I am using >&. What is the equivalent in ksh?? >& - redirect stdout and stderr (csh,tcsh) (18 Replies)
Discussion started by: kristinu
18 Replies

9. Shell Programming and Scripting

\n in ksh using echo & printf

#!/usr/bin/ksh var1="Hi World" var2="Morning" var3=$(echo "$var1" \n "$var2") echo $var3 var3=$(printf "$var1 \n $var2") echo $var3 Output Any way to get in my $var3 ? (7 Replies)
Discussion started by: dahlia84
7 Replies

10. Shell Programming and Scripting

[Solved] BASH - chaining TEST and COMMAND with && and II

Can you explain what this line of script is doing. What I have understood is : -- variable C is the name of a software which is either not installed, so it must be installed or allready installed and then should be update if newer version found -- branch B="$B $C" is to install the software --... (4 Replies)
Discussion started by: jcdole
4 Replies
RBASH(1)						      General Commands Manual							  RBASH(1)

NAME
rbash - restricted bash, see bash(1) RESTRICTED SHELL
If bash is started with the name rbash, or the -r option is supplied at invocation, the shell becomes restricted. A restricted shell is used to set up an environment more controlled than the standard shell. It behaves identically to bash with the exception that the follow- ing are disallowed or not performed: o changing directories with cd o setting or unsetting the values of SHELL, PATH, ENV, or BASH_ENV o specifying command names containing / o specifying a file name containing a / as an argument to the . builtin command o specifying a filename containing a slash as an argument to the -p option to the hash builtin command o importing function definitions from the shell environment at startup o parsing the value of SHELLOPTS from the shell environment at startup o redirecting output using the >, >|, <>, >&, &>, and >> redirection operators o using the exec builtin command to replace the shell with another command o adding or deleting builtin commands with the -f and -d options to the enable builtin command o using the enable builtin command to enable disabled shell builtins o specifying the -p option to the command builtin command o turning off restricted mode with set +r or set +o restricted. These restrictions are enforced after any startup files are read. When a command that is found to be a shell script is executed, rbash turns off any restrictions in the shell spawned to execute the script. SEE ALSO
bash(1) GNU Bash-4.0 2004 Apr 20 RBASH(1)
All times are GMT -4. The time now is 03:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy