LinuxQuestions.org
Help answer threads with 0 replies.
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, 06: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, 02:27 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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, 08: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, 09:25 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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, 10: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, 12:11 PM   #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, 12:17 PM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
@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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07: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 06:08 AM
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 08:11 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 09:31 AM


All times are GMT -5. The time now is 10:21 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration