Solved

unix example issues

Posted on 2016-10-21
18
49 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
  • 9
  • 5
  • 2
  • +2
18 Comments
 
LVL 6

Assisted Solution

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

Assisted Solution

by:Gerwin Jansen
Gerwin Jansen earned 83 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
 
LVL 37

Expert Comment

by:Gerwin Jansen
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 37

Expert Comment

by:Gerwin Jansen
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 37

Expert Comment

by:Gerwin Jansen
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 27

Assisted Solution

by:serialband
serialband earned 83 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 9

Accepted Solution

by:
Carlos Ijalba earned 251 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 37

Expert Comment

by:Gerwin Jansen
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 9

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now