Sponsored Content
Full Discussion: Bash to ksh problem
Top Forums Shell Programming and Scripting Bash to ksh problem Post 302758753 by Chubler_XL on Sunday 20th of January 2013 06:35:50 PM
Old 01-20-2013
Thanks, that might explain why a lot of the old AIX ksh scripts we have around here use print (I've always replaced them with echo or printf, whenever making updates - just because it's more portable).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ksh vs Bash

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)
Discussion started by: krishna
1 Replies

2. Shell Programming and Scripting

Need help : KSH>BASH

Hello, I've written a script in KSH, but now it needs to run on a system without KSH, ie sh or bash etc, bash seems best bet, but the simplest of things don't seem to work.. The snippet below is the main issue, basically I'm reading from a dat file and putting fields into arrays.. Dat file... (5 Replies)
Discussion started by: itsupplies
5 Replies

3. 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

4. Shell Programming and Scripting

ksh to bash mode

Hi guys... I have a ksh shell by default, so when I login to my unix box, all my .profile statements gets executed(including the aliases). But for some reasons(may be not comfortable using ksh), I would always switch to BASH(in the same session but as a child process) but in the process I am... (16 Replies)
Discussion started by: anduzzi
16 Replies

5. 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

6. Solaris

ksh vs bash

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)
Discussion started by: fugitive
8 Replies

7. 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

8. Shell Programming and Scripting

Typeset conversion problem from ksh to bash

Hi, typeset -l sgf # all lowercase letters typeset -u SGF # all uppercase letters sgf=$1 SGF=$sgf these lines used in my scripts . It ran fine in ksh but when we convert this to bash it erroring out. I like to know what the use of typeset ?? Thanks & Regards kanagaraj (3 Replies)
Discussion started by: kanagaraj
3 Replies

9. Shell Programming and Scripting

ksh vs bash

what is diff between KSH and Bash can you tell me some commands which run in either of two but not in both. while doing normal shell programming I am unable to find diffrence between two (2 Replies)
Discussion started by: pasricha.kunal
2 Replies

10. Shell Programming and Scripting

BASH to KSH

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)
Discussion started by: cvsanthosh
3 Replies
print(1)							   User Commands							  print(1)

NAME
print - shell built-in function to output characters to the screen or window SYNOPSIS
ksh print [-Rnprsu [n]] [arg]... ksh93 print [-Renprs] [-f format] [-u fd] [string...] DESCRIPTION
ksh The shell output mechanism. When no options are specified, or when an option followed by ' a - is specified, or when just - is specified, the arguments are printed on standard output as described by echo(1). ksh93 By default, print writes each string operand to standard output and appends a NEWLINE character. Unless, the -r, -R, or -f option is speciifed, each character in each string operand is processed specially as follows: a Alert character.  Backspace character. c Terminate output without appending NEWLINE. The remaining string operands are ignored. E Escape character (ASCII octal 033). f FORM FEED character. NEWLINE character. Tab character. v Vertical tab character. \ Backslash character. x The 8-bit character whose ASCII code is the 1-, 2-, or 3-digit octal number x. OPTIONS
ksh The following options are supported by ksh: -n Suppresses new-line from being added to the output. -r-R Raw mode. Ignore the escape conventions of echo. The -R option prints all subsequent arguments and options other than -n. -p Cause the arguments to be written onto the pipe of the process spawned with |& instead of standard output. -s Cause the arguments to be written onto the history file instead of standard output. -u [ n ] Specify a one digit file descriptor unit number n on which the output is placed. The default is 1. ksh93 The following options are supported by ksh93: -e Unless -f is specified, process sequences in each string operand as described above. This is the default behavior. If both -e and -r are specified, the last one specified is the one that is used. -f format Write the string arguments using the format string format and do not append a NEWLINE. See printf(1) for details on how to specify format. When the -f option is specified and there are more string operands than format specifiers, the format string is reprocessed from the beginning. If there are fewer string operands than format specifiers, then outputting ends at the first unneeded for- mat specifier. -n Do not append a NEWLINE character to the output. -p Write to the current co-process instead of standard output. -r Do not process sequences in each string operand as described above. -R If both -e and -r are specified, the last one specified is the one that is used. -s Write the output as an entry in the shell history file instead of standard output. -u fd Write to file descriptor number fd instead of standard output. The default value is 1. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 Output file is not open for writing. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
echo(1), ksh(1), ksh93(1), printf(1), attributes(5) SunOS 5.11 27 Mar 2008 print(1)
All times are GMT -4. The time now is 08:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy