SunOS shell help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SunOS shell help
# 1  
Old 07-06-2006
Question SunOS shell help

I'm new to SunOS and I need some help.

I'm trying to run the commands below inside the korn shell below on SunOS 5.8 but it does not do anything except echo ABC. No error gets displayed when running the shell.

Code:
#!/bin/ksh

echo ABC
export ENV_1=/folder1/subfolder
cd folder2

All 3 commands above work when I run them outside of the shell at the command prompt.

Any help in getting this shell to work will be greatly appreciated.

Steve
# 2  
Old 07-06-2006
Actually you would not see any messages for the export and cd command. If you want the changes to be permanent, then try running the script as
Code:
. youscript.ksh

rather than just
Code:
yourscript.ksh

or
Code:
./yourscript.ksh

To see the actual effect of your script, try this

Code:
#!/bin/ksh

echo ABC
export ENV_1=/folder1/subfolder
echo $ENV_1
cd folder2
pwd

# 3  
Old 07-06-2006
Vino,

It worked.

Thank you very much for your help!

Cheers
Steve
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to start in a bash shell everytime I logon to SunOS?

Hi I logon to sunos boxes at work that starts in a ksh shell. I would like to login to a bash shell whenever I logon to the sunos boxes instead of having to login and type bash . I tried editing the .profile and added SHELL= usr/bin/bash however when I login I am still in the ksh shell. I... (4 Replies)
Discussion started by: Esa
4 Replies

2. Solaris

SunOS 5.6

Hi, I called Sun and they said they no longer sell SunOS 5.6. I desperately need a CD-ROM of the install CD to perform maintenance work on a server. Does anyone know where to get one or know someone who can make me a copy? (2 Replies)
Discussion started by: mojoman
2 Replies

3. Solaris

SunOS 5.8 vs 5.10

Hi, I am bulding a path to open files like this \path\values\file.xxx This path is opened in an IE browser window and opens the file/document I am trying to see. I mean it opens a pdf document or it promps you to "save" or "open" the specific file (if it's a .xml, .doc, .html). I was using... (1 Reply)
Discussion started by: hcibl_javok
1 Replies

4. Solaris

New to SunOS...

...and I'm having an issue with memory usage. I got an alert from our sun management console that the box is at 90% memory usage. I need to know what's eating up the memory as this particular box has 16GB of RAM. (3 Replies)
Discussion started by: bbbngowc
3 Replies

5. Shell Programming and Scripting

korn shell .kshrc in sunos

Hi, My login shell is c shell I have a line in .cshrc like setenv a 1000 I have a line in .profile like ENV=$HOME/.kshrc export ENV and in my .kshrc a=10 export a I wrote one korn script #!/bin/ksh echo $a (3 Replies)
Discussion started by: shahnazurs
3 Replies

6. Solaris

Looking for help with SunOS 5.6

Hey all, I've got my hands on 10 SunOS 5.6 SPARCStation 20 machines and I'm looking to get them up and running. They're all in various states of disrepair but I've got them all to a state where the hardware is working and the machine will at least attempt to boot. I've only used Solaris as a... (1 Reply)
Discussion started by: kevpatts
1 Replies

7. Solaris

SunOS 5.4

Hi, I Hope you can help me with my problem. I need to have an installation CD of this version. Is there any site you can recommend that I can download an image of this OS? Thanks and God Bless!!! (6 Replies)
Discussion started by: mr_balodoy
6 Replies

8. Shell Programming and Scripting

Unix Korn Shell Array Issue (SunOS)

Hello, I'm currently messing around with arrays for the first time in scripting (Unix Korn Shell). All I'm trying to do right now before I make things complicated is read through and print out to screen whether the read file is or is not a directory. Here is my directory: ls -l total... (5 Replies)
Discussion started by: Janus
5 Replies

9. UNIX for Advanced & Expert Users

Migration of binary file from Sunos 5.8 to Sunos 5.9

I have compiled binary file using "cc" on SunOS 5.8 and the same binary file i have copied to SunOS 5.9 and it is giving me core dump error.I want to know whether migration of compiled code from lower version to higer version created this problem. how can i solve this problem.I am pasting the core... (1 Reply)
Discussion started by: Arvind Maurya
1 Replies

10. Shell Programming and Scripting

SunOS 5.8

I am loging into a SunOS 5.8 box for the first time. I do not see a .profile file in the home directory. Also on the command line when I type a backspace to correct my typing I get a ^H character. Where and how can I fix this? Thanks in advance (5 Replies)
Discussion started by: jxh461
5 Replies
Login or Register to Ask a Question