LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2013, 05:56 PM   #1
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Rep: Reputation: 16
no "yeah boy!" on sunos - what gives?


My SunOS will not go "yeah boy" from the command line - what gives?

Code:
casper@sunny1 > echo $SHELL
/bin/bash


casper@sunny1 > uname -a | awk '{print $1}'
SunOS

casper@sunny1 > x=`uname -a | awk '{print $1}'` ; if [ "$x" == "SunOS" ]; then echo "yeah boy" ; fi
zsh: = not found

but my linux wll :
Code:
[casper@linux1 logs]$ echo $SHELL
/bin/bash

[casper@linux1 logs]$ uname -a | awk '{print $1}'
Linux


[casper@linux1]$  x=`uname -a | awk '{print $1}'` ; if [ "$x" == "Linux" ]; then echo "yeah boy\!\!\!" ; fi


yeah boy\!\!\!
 
Old 09-17-2013, 01:27 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by casperdaghost View Post
My SunOS will not go "yeah boy" from the command line - what gives?
Code:
casper@sunny1 > echo $SHELL
/bin/bash

casper@sunny1 > uname -a | awk '{print $1}'
SunOS

casper@sunny1 > x=`uname -a | awk '{print $1}'` ; if [ "$x" == "SunOS" ]; then echo "yeah boy" ; fi
zsh: = not found
You are using a zsh shell and not a bash shell.

The SHELL variable is bash/ksh specific and will not be changed when using a zsh shell.
 
1 members found this post helpful.
Old 09-17-2013, 07:46 AM   #3
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Original Poster
Rep: Reputation: 16
How do I assign the output of a command to a variable on the command line in ZSH. I have tried looking google for 'assign variable command line zsh' but have nt found anything.
is there some other way that I should phrase it for google
Is there an IRC channel dedicated to ZSH?
This was an attempt at humor, not well recieved - but i use this kind of variable assignments alot.
I think that the sysadmin enabled zsh on the sun boxes to try and add some enhancements to these legacy machines. I can't work as fast with zsh on the sun boxes and it is a pain.
 
Old 09-17-2013, 08:25 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
About your problem, try this:
Code:
x=`uname -a | awk '{print $1}'` ; if [[ "$x" == "SunOS" ]]; then echo "yeah boy" ; fi
Double square brackets vs single square brackets.

About zsh vs bash: Are you forced to use zsh? You could ask the system administrator to change your login shell to bash instead. The sys admin shouldn't force you to use a specific shell unless there is a very good reason to do so.
 
1 members found this post helpful.
Old 09-17-2013, 09:01 AM   #5
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Original Poster
Rep: Reputation: 16
When you ssh to a sunos box it kicks off a script that mounts you a directory and enables ZSH.
I guess i could just get out of ZSH.
funny - when i echo the shell on the sunos box it says BASH, yet I am clearly in the ZSH shell.


The double bracket works on the SUN os boxes.
So I guess it is more of an issue with the version of bash than the shell i am using.
most of the linux boxes are 4.1 and the sun os is 3.0

linux
Code:
[casper@linux1 ]$  bash --version
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

sunos
Code:
casper@sunbox1 > bash --version
GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10)
Copyright (C) 2004 Free Software Foundation, Inc.
 
Old 09-17-2013, 11:11 AM   #6
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Original Poster
Rep: Reputation: 16
i found a great way to get the ip address on a sunos box

Code:
 ping -s $HOSTNAME
 
Old 09-17-2013, 11:17 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
@casperdaghost:

If you are familiar with Linux and want to know what the Solaris equivalent of a command is, then have a look here:

- A Sysadmin's Unixersal Translator (ROSETTA STONE) OR What do they call that in this world?
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unpredictable "delete" "move to trash" or "cut" file menu option dorianrenato Linux - General 3 11-28-2011 06:41 PM
It had to be me ..... "sigh" and the warm embrace........ow yeah Hello:D jayrew LinuxQuestions.org Member Intro 1 01-20-2011 05:08 AM
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 07:11 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration