How to start a Shell Script in a VirtualBox(Ubuntu)?
Hi,so today is my first day with linux.
I have some scripts from a friend and now im trying to run them but it doesnt work. So what i tried is:
-Moved the scripts to a specific directoy (into my document folder)
-then i opened the standard terminal in ubuntu (GNOME-Terminal)
-i typed in "Ls", then "cd Dokumente" and saw my scripts
-next i typed in "chmod +x Scriptname.sh" -->nothing happened
-then i typed "-/Scriptname.sh -->nothing happened
What i am doing wrong? Is the Script uncorrect?
Here it is:
I dont know if the script should return something but i see a "echo" so i think it should.
Should i use another Terminal? Or another editor? Im using notepad++ on windows and gedit on linux
Ups, my fault, i typed ./ Sry for that. Same goes with "sh Scriptname.sh", nothing happens.
I tried ls -1, it just list my scripts, but still not working.
SO the script i posted should return the last 2 parameter. MAybe i need to set them somewhere?
THX
---------- Post updated at 02:57 PM ---------- Previous update was at 02:35 PM ----------
Quote:
Originally Posted by easy123
SO the script i posted should return the last 2 parameter. MAybe i need to set them somewhere?
yep, that was the error. i need to set the parameter-> sh Scriptname.sh 1 2 3
Compare the results you are getting with your current version of test.sh with this alternative (let's call it test2.sh):
and make let us make both of them executable with:
Then see what happens when you execute the commands:
Do you understand why your test.sh command produces eight lines of output while the above test2.sh command with the same arguments only produces two lines of output? Which one of them do you think does a better job of displaying its last two parameters?
Hi,
I need to create a shell script for automated server patching, with the following scenario:
I have two Linux servers Primary and secondary.
Server patching should start on Primary 1st and then secondary.
1st check both servers are up and running.
Then stop primary and patching will... (1 Reply)
Is it possible to start Ubuntu (or any other modern UNIX OS) or get it to any usable state without the init software.
By this I mean replacing init with bash and manually initializing all the components.
So far i've managed to edit grub at start and get the bash shell but I don't know where... (3 Replies)
Hello,
I could not find the appropriate forum for my problem to boot Ubuntu 12.04.2 server amd64 on Oracle Virtualbox(4.3.0 BETA1) within Win 7, so I posted here to start.
For some reason Ubuntu could not boot anymore, and I am looking any suggestion before I re-install it as I do not want to... (0 Replies)
i have found a way to start vm with commanda as follows -
VBoxManage startvm <uuid>|<name>
it is installed inside oracle virtualbox.
in vmware we have a way to do this --
$vmware-cmd -v -H localhost -U user -P password /var/lib/vmware-server/Virtual\ Machines/Ubuntu/Ubuntu.vmx... (0 Replies)
Hi,
I’ve a shell script. If I trigger the script it takes one day to complete the execution.
I’ve to start the same script in 3 different logins of Unix machine simultaneously. Do you have any idea how can I make it? Please suggest.
Thank you..
Stop making the font size smaller than... (3 Replies)
Hi,
Pleasse could someone advise why i'm getting this error below - No such file or directory
dev6:$ ls -ltr ReleaseManagement.sh
-rwxr-xr-x 1 dev fix 4830 Aug 22 11:13 ReleaseManagement.sh
dev6:$ ./ReleaseManagement.sh
: No such file or directory
dev6:$
thank you (2 Replies)
Hi All,
I would like to develop a shell script for stop & start an application server (1-4) on Solaris box. Here are the user requirements for this task.
1. User will input the option which server they wish to stop.
2. Will clear cache files from specific location.
3. ... (1 Reply)
Hello,
I'm trying to create a VirtualBox "harddisk" and put an dd-image into it. This image shoudn't work as a virtual maschine, I just want to be able to mount it to an folder. How can I do this with an shell script?
Sebi
---------- Post updated at 10:36 AM ---------- Previous update... (0 Replies)
I got the below script on line but can't seem to get it to work as there are syntax errors where 'len' is shown. Can anyone help with this??
echo " Enter the String"
read str
echo $str > str.txt
len = 'echo $str | wc -c'
len = 'expr $len -1'
c= 0 , w = 0 , s = 0 , i = 1
echo " Length... (1 Reply)