Ubuntu :: Test Command In Shell Script?
Aug 29, 2010
I was trying to write a script, but for some reason I can't test two variables using -gt:
a=`expr $currentSize + 0`
b=`expr $fileSize + 0`
[$a -gt $b]
this is what I get:
[22234534: not found
what is the problem? It seems like I can't check if a variable is greater than another but only if a variable is greater than a fixed number. Is that so? By the way the variables $fileSize and $currentSize exist and $a and $b have a value.
View 9 Replies
ADVERTISEMENT
Nov 8, 2010
Cis 140 student.how to use the test command to evaluate whether the shell variable I create contains a referance to the bash shell? and use the echo command to determine the result.
View 1 Replies
View Related
Aug 29, 2010
Trying to create a small script that will read user's input, test if user entered some input and if not display some message or display a text using user's input.
The script is the following but i get an error saying "[: 6: =: argument expected"
View 12 Replies
View Related
Oct 22, 2010
I have ubuntu 10.10 desktop .. and i wanna try The new Gnome shell?
View 4 Replies
View Related
Jan 16, 2011
I've searched and read lots about trying to get gnome-shell to run in Virtualbox(v4) with no success on my end. Lots of the posts are outdated and are using Virtualbox 3.
So anyone have any tips or hints for testing the Gnome-shell? (I'd prefer to test in with 10.10 in Virtualbox 4, but am open to upgrading to 11.04 if necessary)
View 9 Replies
View Related
Feb 21, 2010
I was looking at this line in an init file:
Code:
test -f /etc/default/postfix && . /etc/default/postfix
Which I understand to mean test that files /etc/default/postfix AND etc/default/postfix exist. Two things
[code]....
View 2 Replies
View Related
Aug 5, 2010
What will be the output of the following Shell Script?
Code:
a="1245"
[-n $a]
[code]...
View 5 Replies
View Related
Mar 4, 2010
I'm trying to do the following. from a php webpage click on a link, that opens a shell/cmd and runs an open ping to the device. so it must actually open a shell (for linux) or cmd (for windows) and run a ping to the specified ip. Currently i'm running an exec command, but for this i need to wait for the result to be fetched and print it out. I want to monitor it in realtime, by just clickingon the button. How to get this working?
View 1 Replies
View Related
Jan 4, 2011
Some may recall I recently gave up on bash, rather than give up my programming style.Surely I will have reason to return but that's another story. My little issue now:I am debugging a new [Korn] shell script. I have a function that performs a specialized match on a string and I see that I am able to call that function with no problem, with both of it parameters. The function does not do any print or echo command - it uses "return" for a TRUE (0) of FALSE (1), as is the shell exit code convention. Thus, I have the following test:
Code:
if [[ match_except_release ${PATH_DIR[$LC]} bin ]]
then
[code]....
View 2 Replies
View Related
Feb 7, 2011
I need to run a self-test on my external USB drive and don't want to use System -> Disk Utility.I've taken a look at the man page for udisks and curiously, there does not appear to be an option for self tests. Is there a way to run a self test using udisks directly from the command line?
View 9 Replies
View Related
Jun 26, 2010
I'm using a remote dedicated server running ubuntu server edition, and I have no idea what the upload/download speeds are.Is there a reliable method to test these speeds via the command line?
View 2 Replies
View Related
May 6, 2011
I remember there is a command in the console to test the camera, without having to install any chat clients.
View 4 Replies
View Related
Oct 20, 2010
I am using gtk to program GUI. How can I show the output of shell command into a textbox, ex ps -efc command ?
View 3 Replies
View Related
Sep 7, 2010
I loaded FED 13 and running kernel 2.6.34.6-47 fc13, Now back from holiday, I'm trying without success to sort out a few problems. 1 can not print. the printer sets up OK epson R285, but can't print test pages or from any app, or from CLI with lpr command. Cups log shows this:-
[Code]....
View 1 Replies
View Related
Jul 8, 2011
Ehlo command not recognizing while sending test mail to outside network from postfix. When I am trying to test a mail within the network it is successfully happening ehlo.
View 2 Replies
View Related
Jan 4, 2011
anybody knows nice tool to check connection speed UPLOAD / DOWNLOAD on the server ?Maybe existing something like speedtest.net for servers ?
View 3 Replies
View Related
Mar 15, 2010
I am trying to install mysql 5.1.44..so i downloaded the binary package, i extracted it and then followed the instructions that were in the manual but i keep getting this error when running this command
Code:
scripts/mysql_install_db --basedir=/home/mosty/mysql
the error is
Code:
Installing MySQL system tables...
100315 20:07:27 [Warning] Can't create test file /var/lib/mysql/mosty.lower-test
100315 20:07:27 [Warning] Can't create test file /var/lib/mysql/mosty.lower-test
[code]....
You can try to start the mysqld daemon with:
shell> /home/mosty/mysql/bin/mysqld --skip-grant &
and use the command line tool /home/mosty/mysql/bin/mysql to connect to the mysql database and look at the grant tables:
shell> /home/mosty/mysql/bin/mysql -u root mysql
mysql> show tables
View 1 Replies
View Related
Apr 8, 2009
I have installed Postfix + Amavisd-new, then I am started all services (and configured main.cf and master.cf to use amavis).
The questions are:
1) I am trying to test antivirus scan using eicar test virus
Code:
And the message is successfully delivered to mailbox with mark "CLEAN" in maillog. But I cant see any attachment using
Code:
Where is my mistake?
2) Should I update clam and how I can do it?
3) Is spamassassin enabled by default in amavis (I have started daemon)?
4) Where configuration files of spamassassin is stored?
View 1 Replies
View Related
Mar 26, 2011
I have created mobility of 20 nodes and vbr traffic using following attached script I executed the file as ns234 vbr.tcl I got the vbr.tr and vbr.nam but I was unable to load the graph using matlab <trgraph> I thought problem with is vbr.tcl script.
View 1 Replies
View Related
May 10, 2011
command1:
ssh pt@192.168.1.101 ls
command2:
ssh pt@192.168.1.101 totem ~/t1
Cannot open display: Run 'totem --help' to see a full list of available command line options. command1 can run, command2 can not run,would you mind to tell me why?
View 2 Replies
View Related
Mar 16, 2010
Im trying to find out if my computer is whats got my power bill so high. Im not sure it is, but Id like to know if there is a shell command to monitor my power use.
View 3 Replies
View Related
Jul 6, 2010
I was using windows recently and noticed that in their command line, the autocomplete is in some ways a little more intelligent (although based on my short experience ours is more robust); for example, if you have a directory named blah and a file name bl, in Linux "cd bl <tab>" will result in "cd bl" while in Windows I get "cd blah" because it recognizes that blah and not bl is the appropriate argument to cd. Similarly unrar will target rar files first.I am not saying Windows command line is better; Windows command line is in general a piece of junk.
View 2 Replies
View Related
Aug 20, 2010
What's the command to access a secure shell?
View 2 Replies
View Related
Aug 22, 2010
How can I open a script in a shell (konsole/terminal) with one command?
View 6 Replies
View Related
Jan 1, 2011
How do i find out if a particular item is a file or a folder through the terminal ls -la gives 'd' before the permissions for every folder and '-' before every fileLike i want to write a script that backup data if it is a folder and deletes if it is a file
View 2 Replies
View Related
Apr 26, 2011
The short version: I have to manage some virtual machines using php shell_exec function, so far I cant do this because apache is run by the user www-data and virtualbox by the user vboxuserFrom what I've read so far, I've thought of 3 possible solutions: 1.- Create a script on my vboxuser that I can call from php to manage the Virtual Machines.2.- Change the apache user from www-data to vboxuser so I can manage the Virtual Machines through php
3.- Reinstall VirtualBox, this time using www-data as my user. I'm not sure if any of these will work and I'm not too sure of which would be the best solutionNow the longer more detailed version:
I have a remote server running Ubuntu 10.04.2, in that server I have set up VirtualBox so I can run several instances of WinXP to perform different tasks. Everything is setup and I can manage the virtual machines through SSH. If I want to run them as a different user than the one that created them (a user that so far only has been used to create the Virtual Machines) I have to do sudo -u vboxuser.Now, I need to create a PHP script to manage these virtual machines (I know about phpVirtualBox, but it's not what I need). If I try to run the virtual machines using shell_exec() from php, I get no answer at all (And I have tested that shell_exec is working on my server).
View 6 Replies
View Related
Jul 12, 2011
I write LaTeX in Emacs and then run a shell script to process the LaTeX code. I used to run a subshell buffer with M-x shell and then execute the script from within there, but this results in a lot of switching between buffers, which seems unnecessary. Then, I found out about executing shell commands with M-! cmd RET, as described here:[URL]The problem with this is that the output from the script splits my screen. It's a nuisance, and I would like to run the script without any output. I've tried appending > /dev/null to the command, but it doesn't work.For example, when from within Emacs I enter M-! followed by
Code:
sh make.sh > /dev/null
it splits my screen so that one portion displays output from the make.sh script. I want it to run silently, and leave my Emacs buffers alone
View 3 Replies
View Related
Jun 15, 2010
I am using Red Hat Linux Enterprise version 5. I've noticed people sometimes running commands with a couple of & options. For example, in the below command, there are two & signs. What is the purpose of them? Are they always used together with nohup?
nohup foo.sh <script parameters> >& <log_file_name> &
View 6 Replies
View Related
Jan 18, 2011
This is an extremely weird issue that I can't find any help with on Google. It is minor but extremely annoying.
When I type in a linux command in the terminal, (e.g. "ls -la"), and then press enter, the cursor goes to the next line and just sits there, as if its processing some long command.
If I press enter again, I see the ls output as well as my prompt twice. It's like the terminal window isn't auto-scrolling, but I've also seen this happen when there wasnt even enough text in the console screen to warrant a scrollbar. Has anyone seen this before and know what I need to do? I hope what I'm asking about makes sense.
View 3 Replies
View Related
Jan 28, 2011
I cannot find the way to run some command for a subset of files in directory - how can I do it
View 3 Replies
View Related