Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

unix example issues

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
SOLUTION
Avatar of Thomas Wheeler
Thomas Wheeler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

i tried mirro site b`````````elow

United States:

California: mirrors.kernel.org(ftp)

did not work please advise
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
Avatar of gudii9

ASKER

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
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 :)
Avatar of gudii9

ASKER

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?\
>> 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/
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

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
Avatar of gudii9

ASKER

how baboon, cygwin and mobaXterm are different or similar? which one to prefer?
Avatar of gudii9

ASKER

what are avantage and disadvantages of each?
Avatar of gudii9

ASKER

#!/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
Avatar of gudii9

ASKER

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
Avatar of gudii9

ASKER

unary operator expected
too many arguments errors coming??
please advise
>> 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.
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!