Computing.Net > Forums > Linux > linux bash shell script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

linux bash shell script

Reply to Message Icon

Name: osaru
Date: March 12, 2004 at 03:38:37 Pacific
OS: SUSE
CPU/Ram: 1G
Comment:

I find bash shell script runs on unix does not run on linux(SUSE). For example even the following simplest one gives me an error on SUSE,but unix.
Is this something wrong with bash on SUSE?
or linux shell script and unix shell script are different?
#! /bin/bash
echo -n "Give me a directory name :"
set ans = $<
echo $ans



Sponsored Link
Ads by Google

Response Number 1
Name: Dlonra
Date: March 12, 2004 at 18:08:45 Pacific
Reply:

which "unix"?
are you quite sure you are using the bash shell on "unix"?"



0

Response Number 2
Name: Ronald
Date: March 13, 2004 at 19:14:11 Pacific
Reply:

I dont think bash is the default on unix. Most of the unix machines I have been on had the P shell or K shell as default.
I believe if you type [echo $SHELL]Without the brackets it will return the shell you are in.
You can change your default shell in unix if you have the correct permissions in your user profile.
Another thought make sure you are using bash on SuSe.
Good luck
Ron


0

Response Number 3
Name: osaru
Date: March 13, 2004 at 23:14:00 Pacific
Reply:

I use bash both on unix and suse. I just can't figure out what's causing the problem.
eri


0

Response Number 4
Name: 3Dave
Date: March 15, 2004 at 08:39:38 Pacific
Reply:

How about:

#!/bin/bash
echo -n "Give me a directory name :"
read ANS
echo $ANS


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Wich linux is redhat Help! network connection ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: linux bash shell script

shell script www.computing.net/answers/linux/shell-script/17185.html

run shell script on linux www.computing.net/answers/linux/run-shell-script-on-linux/28735.html

Bash Shell Script www.computing.net/answers/linux/bash-shell-script/24873.html