Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

unix example issues

Posted on 2016-10-21
18
Medium Priority
?
126 Views
Last Modified: 2016-10-29
hi,

I am trying unix .sh scripts on my windows laptop
https://www.tutorialspoint.com/unix/unix-loop-control.htm
#!/bin/sh

a=0

while [ $a -lt 10 ]
do
   echo $a
   if [ $a -eq 5 ]
   then
      break
   fi
   a=`expr $a + 1`
done

Open in new window

from below link
https://www.tutorialspoint.com/unix/unix-loop-control.htm

i am not sure how to execute in baboon software

Babun
http://babun.github.io/


cygwin i am not able to install as it gives error not able to find download sites as attached.

any good graphical user interface tool to run these unix shell scripts
what is best site to know about these scripts
baboonErr.png
cygwinErr.png
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 5
  • 2
  • +2
18 Comments
 
LVL 7

Assisted Solution

by:Thomas Wheeler
Thomas Wheeler earned 332 total points
ID: 41854400
I would use cygwin. Just add one of the mirror sites to the list and install
Mirror Sites
0
 
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 332 total points
ID: 41854408
Or install VMware player and then run a virtual Linux installation. Much better than cygwin.
0
 
LVL 7

Author Comment

by:gudii9
ID: 41854441
i tried mirro site b`````````elow

United States:

California: mirrors.kernel.org(ftp)

did not work please advise
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 41854445
I try mirror sites every day. You have to tell us what you tried or we won't be able to help you further.

Just go here and select the 32 or 64 bit installer: https://cygwin.com/install.html
0
 
LVL 7

Author Comment

by:gudii9
ID: 41854492
error is as atached.

how to verify outside cygwin whether mirror site works or not like ping etc from my windows laptop
cygwinAdd1.png
cygwinAdd2.png
cygwinAdd3.png
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 41854502
You do not have a working internet connection or a firewall / antivirus application that is blocking the cygwin setup to connect to the internet to get the setup files. You have to fix that first. Or get VMware and install Linux in a VM :)
0
 
LVL 7

Author Comment

by:gudii9
ID: 41854505
can i download offline copy  of cygniw to download and to install to avoid these firewall related issues

not sure how to  get VMware and install Linux in a VM ? any link for that?\
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 41854559
>> can i download offline copy  of cygniw to download and to install to avoid these firewall related issues
Not that I know of, fixing your issue would be better anyway.

VMware Player: https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/12_0

Prebuilt Linux VM's are here, for example Fedora: http://www.osboxes.org/fedora/
0
 
LVL 30

Assisted Solution

by:serialband
serialband earned 332 total points
ID: 41854842
There was a major DNS DDOS on DYN today.  If you were in the USA, then you would have had problems conecting to many major sites at the times of your post.  You should be able to connect now and update cygwin.

https://krebsonsecurity.com/2016/10/hacked-cameras-dvrs-powered-todays-massive-internet-outage/
1
 
LVL 10

Accepted Solution

by:
Carlos Ijalba earned 1004 total points
ID: 41855354
You can also download the MobaXterm Personal Edition, that works fine, as it integrates cygwin and busybox in a local terminal session:

[2016-10-22 18:10.03]  ~
[Carlos.Workstation] ➤ /bin/sh
[2016-10-22 18:10.13]  ~
[Carlos.Workstation] ➤ a=0
[2016-10-22 18:10.13]  ~
[Carlos.Workstation] ➤ while [ $a -lt 10 ]
> do
>    echo $a
>    if [ $a -eq 5 ]
>    then
>       break
>    fi
>    a=`expr $a + 1`
> done
0
1
2
3
4
5

Plus it is also a session SSH, RDP, FTP, HTML manager, very handy:

http://mobaxterm.mobatek.net/
0
 
LVL 7

Author Comment

by:gudii9
ID: 41857463
a=0

while [ $a -lt 10 ]
do
   echo $a
   if [ $a -eq 5 ]
   then
      break
   fi
   a=`expr $a + 1`
done

Open in new window


to run above we need execute separate

#!/bin/sh
then



while [ $a -lt 10 ]
do
   echo $a
   if [ $a -eq 5 ]
   then
      break
   fi
   a=`expr $a + 1`
done
0
 
LVL 7

Author Comment

by:gudii9
ID: 41857465
how baboon, cygwin and mobaXterm are different or similar? which one to prefer?
0
 
LVL 7

Author Comment

by:gudii9
ID: 41857467
what are avantage and disadvantages of each?
0
 
LVL 7

Author Comment

by:gudii9
ID: 41857471
#!/bin/sh

a=0

while [ $a -lt 10 ]
do
   echo $a
   if [ $a -eq 5 ]
   then
      break
   fi
   a=`expr $a + 1`
done

Open in new window


i was able to copy paste whole above lines and got
1
2
3
4
5

what is first line do?
#!/bin/sh
0
 
LVL 7

Author Comment

by:gudii9
ID: 41857495
while running one scrpts says 401 error authorization error. not sure why

http://core.brc.iop.kcl.ac.uk/wp-content/uploads/2014/01/TutorialsZinaIbrahim.pdf
0
 
LVL 7

Author Comment

by:gudii9
ID: 41857502
unary operator expected
too many arguments errors coming??
please advise
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 41859339
>> to run above we need execute separate
That is a question?

>> how baboon, cygwin and mobaXterm are different or similar? which one to prefer?
Depends on your purpose. What do you want to do? Just practice? Then just pick one. When you want to use real bash or ksh functionality, just run a VM.

>> what is first line do?
You mean "What does the first line do?" - this is called a Shebang - basically, it tells the system to run your script (program) with that shell - https://en.wikipedia.org/wiki/Shebang_(Unix)

>> while running one scrpts says 401 error authorization error. not sure why
Simple - HTTP Error 401 means Unauthorized - you do not have access to that what you're trying to get

>> unary operator expected
Not too many, not enough arguments/parameters. Most likely a variable is empty. Post your full output so we can analyse.
0
 
LVL 10

Expert Comment

by:Carlos Ijalba
ID: 41865145
OK,

let's see, if what you want to try is linux from a windows box, then you can do a million things to do this, one is install cygwin, which is a port of linux utils for windows, other is install the old microsoft's unix environment for windows, another is install the ubuntu bash shell for windows 10, which has been developed by canonical & microsoft, etc.

However the easiest and fastest is to try MobaXterm, that's why I suggested it to you.

MobaXterm is a terminal connection manager that supports loads of functionalities and protocols, and that just happens to install and configure cygwin to be used as a local terminal session, and it also integrates busybox. But they are different things, MobaXterm doesn't have anything to do with cygwin, is like comparing microsoft's powershell with norton commander.

If you want to install cygwin, and configure it, then go ahead, but you will need to know a few basics first, therefore:
Better to try MobaXTerm first, and save yourself some trouble.

For the rest of the questions, they should go to another linux/unix questions, this one has been resolved, Thanks!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question