I am not clear why the cnt variable is not increased in the script below:
The files for input:
when I run script I get:
When I change to Korn shell by using #!/bin/ksh instead script works as expected and I see result as
Why is that? does it mean under bash the scope of cnt variable outside while loop is not the same as cnt inside the wihile loop?
Just in case, the bash is:
Clarification will be appreciated.
Hi Buddy,
Can any one help me to overcome from the below problem?
#/usr/bin/ksh
typeset -Z dd
dd=1
echo $dd
===========
out put for the above is 01
same script I'm migrating to bash but typeset -Z option is not found in bash, Pls get me the equivalent option in BASH
Thanks in... (1 Reply)
Hi
I have a question about the scope of variables for parent and a child
I had written my code here and the output of this but only in child
process the information is completely right even in main the informatin is wrong
well the child process will see the global variable te2 and can change... (5 Replies)
Hi All,
I need to pass a variable to perl script from bash script, where in perl i am using if condition. Here is the cmd what i am using in perl
FROM_DATE="06/05/2008"
TO_DATE="07/05/2008"
"perl -ne ' print if ( $_ >="$FROM_DATE" && $_ <= "$TO_DATE" ) ' filename"
filename has... (10 Replies)
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)
Hi,
I've a general question regarding shell. I 've seen that every where i worked in production environment people are using ksh .. but i like to use .. bash .. is there any particular reason why hardcore sysadmins use ksh ? (8 Replies)
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)
Over time i have developed a library of useful (ksh) functions which i use in most of my scripts. I use the ksh's FPATH variable to locate all these functions and use a standard environment-setting-function to always have the same environment in all my scripts.
Here is how i begin scripts:
... (3 Replies)
I have a script in KSH and now need to incorporate this into another script which is in BASH. OUr script contains code like below in good number of places.
Eg: echo “A B C” | read VAR1 VAR2 VAR3
This works only in ksh and not in BASH. Please let me know
1. Which is the equivalent... (3 Replies)
Hello,
First post for Newbie as I am stumped. I need to get certain elements for a specific PID from the ps command. I am attempting to pass the value for the PID I want to retrieve the information for as a variable. When the following is run without using a variable, setting a specific PID,... (3 Replies)