Ubuntu :: Script Driving Nuts With If Statements?

Oct 21, 2010

I for the life of me is having a hard time with some scripting in Dash with branching statements. What the heck? I read many tutorials all over the net and none of the codes work. They suggest all sorts of variations, but it ain't working for me. Can anyone tell me why the code below always return "Y"?

Code:
#!/bin/sh
clear
echo -n "---> Enter Y or N? "
read answer
if [ "$answer"="Y" ] ; then

[Code]...

Perhaps someone can give me a short explanation on how if statements work? So far my linux experience has been nothing, but a frustrating mess.

View 4 Replies


ADVERTISEMENT

Fedora :: Low Signal Warning Is Driving Nuts?

Apr 6, 2011

A week or so ago there was update to Fedora 14 that affected the wlan settings. Since then I keep getting a "low signal on..." warning. This flashes up at least every five seconds. I KNOW I have a low wi-fi signal! I don't need constantly reminding of it. Is there any way I can turn this warning off? I am using KDE4.6.1.

View 12 Replies View Related

Ubuntu :: Evolution's "Remember Password" Is Driving Nuts?

Jul 4, 2010

I have Evolution set up to monitor three GMAIL and five AOL email accounts. On all of them I have the servers set up correctly and all the right settings to check email 65-75% of the time. But for some reason, even though I have the "Remember this password" box checked for all of my AOL accounts, it will ask me over and over and over and over and over and over again for the passwords for all of my AOL accounts. The GMAIL accounts seem to work flawlessly.

I know that I have the correct passwords because I am cutting and pasting from a text file with known working passwords. And sometimes it will accept the passwords and everything is happy. But other times (like tonight) I can put in the passwords six or seven times for each account and it still gets all pissy. I can close and reopen evolution and re-enter the passwords and it still sits there in a seemingly endless loop of asking for the password.

Is there anyway to convince it to remember my passwords and NOT ask me for them again? I don't care if it writes an entry to a log file saying that logging into the server failed. I don't care if it flashes a little light or plays an annoying chime or something everytime it fails. But I swear I am an inch away from putting my fist through my monitor if it keeps popping up the g.d. dialog asking for my passwords every six seconds! I would switch back to Thunderbird in a heartbeat if the mailbox formats were compatible.

View 3 Replies View Related

Ubuntu Installation :: 10.4 Upgrade, Xorg, Cpu, Fans Gone Nuts Running High/low?

Apr 28, 2010

I upgraded my Asus Eeepc 900a to 10.4 yesterday. Since then, Xorg has averaged between 30-40% CPU, and my fans have gone nuts running high/low/high/low, ad nausium.

Any ideas what might be going on? Another clue perhaps: on reboot or shutdown, I get a "program not responding" message with "unknown" as the hung program. I have not been able to determine what this program is or if it is related to the hyperactive Xorg.

View 9 Replies View Related

Ubuntu :: The Screen Shaking Is Driving Crazy?

May 3, 2010

I cant get Xubuntu to to work on both a specific resolution & a refresh rate at the same time?! what should I do?!the resolution is listed with only one refresh rate! :Slately I don't know what happened to my monitor..but it's shaky all of a sudden..I read articles about that..no new hardware was installed...the card is in it's place..but suddenly it needed to work on @85Hz while it was working on 60@ish or something..t, regardless of the monitor thing...how can I change the refresh rate without changing the resolution on Xubuntu?

View 6 Replies View Related

Ubuntu :: Using Variables In Awk IF Statements?

Nov 2, 2010

I have a list of names (testnames.txt) and I have a set of log files (testlogdata.log). I'm trying to search the column in my log file for each of the names in my testnames.txt file, and output the result to individual files, name1.txt, name2.txt, name3.txt, etc the names in the column of my log file can appear in different formats , ie the name "Tom Smith" can appear as "tom_smith", "tom-smith", "ACME/tom.smith", "ACME/thomas.smith". etc. To allow for the variations, I have my names in the testnames.txt as expressions, ie, for tom smith, I use the expression "to.*smith", etc.I'm running the following command:

for i in $(cat testnames.txt); do awk '{if ($9~/$i/) print $0}' testlogdata.log > $ioutput.log; done

I want the command to read a value for i, insert it into the if ($9~/inserted value for i/, and dump each line from testlogdata.log into a file named <value-for-i>output.log.

View 4 Replies View Related

Server :: Can't Bind To Address 0.0.0.0:80, Driving?

Jul 22, 2010

I'm using xubuntu 9.10. NOT ubuntu server. I need to install a lamp server on my box. I cannot install a new OS like ubuntu server, have to use what I got.when I run apache2, I get:

Quote:(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down Unable to open logs I've changed the port that php listens too to 8080, 81, and I get the same message but with the new port number.

I've removed and installed apache three times, read all kind of threats on the web, but cannot find the solution! it's just driving crazy.

View 3 Replies View Related

Fedora Installation :: FC14 Installer Not Driving Video Card?

Aug 14, 2011

I am about to upgrade my wife's PC from FC12 to FC14. The DVD boots OK and the disk check passes OK. The installer get to the point that it says 'Running Anaconda' (or words to that effect), then the screen is cleared, a brief flash of garbled graphics appears at the top of the screen, then all goes blank.

If I select the option to install using a basic video driver, I get the expected installation screens appearing centred but scaled down within the display, as though the image was a 640x480 window in, say, a 1024x768 display (those figures are guesses, but give the right idea).

I can install this way, but first want to check that this will not leave me with a scaled-down display when I boot to FC14. In other words, will FC14 recognise my (elderly) video card correctly, even though the installer does not?

The machine is running fine under FC12 and I did not strike this problem when I upgraded it to that version.

I have tried the upgrade using two different DVD images, in case one had a fault that the disk check did not pick up.

View 3 Replies View Related

General :: Shell Script Statements In Init?

May 21, 2010

I have made some modifications to the init script that runs when my PC boots to take me to a /bin/sh shell so I can run some custom scripts. When I exit from here the init statement should mount the root file system and switch_root to it. This all works correctly however the same init statement will be run on two types of pc's and the address of the root fs is different between them. On one PC it sits on /dev/sda1 and on the other /dev/hda1. To select the appropriate addresses I used dmesg to find out if it was the i5 PC and if/else statements to select the right hard drive location.

When I try use a if/else statement in the init script it ends up preforming both the if and the else code. Is there any reason the if else statements wouldn't work the exact same in the init script (it's all shell scripts isn't it?

[Code]...

View 3 Replies View Related

General :: Looping Through A Shell Script With Sql Statements?

Oct 7, 2009

I'm working on the Solaris environment and the DB i'm using is Oracle 10g. Skeleton of what I'm attempting; Write a ksh script to perform the following. I have no idea how to include my sql query within a shell script and loop through the statements. Have therefore given a jist of what I'm attempting, below.

1. Copy file to be processed (one file at a time, from a list of 10 files in the folder ).

Code:

for i in *
do
cp $i /home/temp

2 . Create a snapshot(n) table : Initialize n = 1

Code:

create table test insert account_no, balance from records_all; -- creates my snapshot table and inserts records in SQL

3. Checking if the table has been created successfully:

Code:

select count(*) from snapshot1 -- query out the number of records in the table -- always fixed, say at 400000

Code:

if( select count(*) from snapshot(n) = 400000 )
echo " table creation successful.. proceed to the next step "
else
echo " problem creating table, exiting the script .. "

4. If table creation is successful,

Code:

echo " select max(value) from results_all " -- printing the max value to console

[code]....

View 7 Replies View Related

General :: Case Statements In Bash Scripts

Sep 4, 2010

while learning to write bash scripts, i decided to write some script that, given an integer as input, will tell you the square root of that integer (provided the integer in question is a perfect square). i have already done on using primarily if statements and a while loop. i decided that using a case statement would be a lot simpler and i would be able to make the script more functional. here is what i have so far

[Code]....

i have tried all posible combos of using -ge or >= but i get pretty much the same thing.
the idea is, for now, if the input is greater than or equal to 0 that it will echo test. can you do this sort of thing with case statements? or will it only work if i give it specific values like [1-9] (if this is the case then i dont think the case statement will work for what i want to do)

View 4 Replies View Related

Programming :: Cannot Get Conditional Statements To Work In XDialog/Dialog

Feb 5, 2011

I cannot seem to get if else statements to work. if $choice == Dog then i want it to say "you selected Dog" The variable choice has the value Dog in it as proved at the end by echo "yes $choice is $choice" following the error Code: ./test.sh: 37: [$choice: not found How do i get the conditional statement to work? What's wrong here? This is the full script:

Code:

#! /bin/sh
: ${DIALOG=dialog}
: ${DIALOG_OK=0}

[code]....

View 7 Replies View Related

Programming :: If Statements With Decimal Places - Compare It To A Predefined Value

Aug 11, 2010

I'm writing an if statement where a variable is a number such as 14.05 (this is actually a temperature) and I want to compare it to a predefined value, sample code below:

Code:

I have all sorts of errors regardless of how I do this (double quotes, square brackets). The best idea I've had is stripping off the decimal place so it's a 4 digit number (e.g warning=1503 and DEV_TMP=1405) however this seems a little unnescessary and I'm sure there's an easier way of achieving the same thing.

View 11 Replies View Related

Programming :: SQLite Read, Write, Select, Compare Statements For C++

Jun 9, 2010

I am using C++ with SQLite db in a program that will read read a sub set of records, compare records and write different records to another database. I have a SQLite book, but it only shows examples for the C API. Anyone have code samples in C++ for the following:

Open database
Close
Select *
Read
Write

Or, just show me how to execute a SQL statement with C++ and I can then figure out the various SQL statements I need.

View 5 Replies View Related

General :: Bash Scripts - Comparing Multiple Items Or Conditions Using 'if' Statements?

Mar 12, 2011

comparing multiple items or conditions using 'if' statements? I want to do something if one or more conditions is true, for example:

If a = 1 or b = 1.

I've tried:

[Code]...

View 5 Replies View Related

General :: Toshiba Tecra M2S With NVIDIA GeForce FX Go5200 Driving Dell External Monitor Quits Working

Mar 29, 2010

I've been trying to get it to work on my laptop off and on for several years now, experimenting first with Redhat (version 6.1, I think) and now trying with Ubuntu 9.04. I've done a full install using the entire hard drive (no dual boot). So I'm trying it for real this time. I'm having a problem with my video drivers. The video is ok (not great) and I don't seem to have any options to adjust it.

When I go into system > preferences > display, I see monitor "unknown", set at 1024x768 with a 75 Hz refresh. If I click on "detect monitors" nothing happens. It says under system > administration > hardware drivers that "no proprietary drivers are in use on this system". I've got two options:

[code]...

For the first part of boot, I have access, but then when it comes up into Ubuntu, the big monitor (a Dell 2500, I think, plugged into the stock Toshiba docking station via DVI) quits working, and all I have is a dim picture (dark, like something's sapping power from it) on the laptop display.....

View 4 Replies View Related

Ubuntu Installation :: [Errno 13] Permission Denied: U'C:\ubuntu\install\ubuntu-10.04-desktop-amd64.iso'

Jun 29, 2010

I'm new to Linux, so I decided to try using Wubi to get started. THe problem is, when it finished installing 10.04, I got this message: OSError: [Errno 13] Permission denied: u'C:\ubuntu\install\ubuntu-10.04-desktop-amd64.iso' Is there any way around this? It might just be that overly restrictive thing called Vista (which I have the bad luck to be using). I was considering getting a USB drive for Ubuntu anyway..

View 1 Replies View Related

Ubuntu Installation :: Errno 13 Permission Denied: U'C:\ubuntu\install\ubuntu-10.10-netbook-i386.iso

Apr 11, 2011

I recently got interested with with OS.. So I downloaded wubi in Ubuntu website. I opted for the Ubuntu Netbook Edition as am using a lappy. However, halfway through finishing download I got an error. The log shows:

OSError: [Errno 13] Permission denied: u'C:\ubuntu\install\ubuntu-10.10-netbook-i386.iso'

View 1 Replies View Related

Ubuntu Installation :: Difference Between The Ubuntu Installer For Windows And The Ubuntu CD Image?

Jan 2, 2010

What is the difference between the Ubuntu Installer for windows and the Ubuntu CD image? If I use the ubuntu installer for windows, does it have the capability to partition my drive, will it enable to share files with windows etc or is it just a way not to have to burn a CD. Just curious, the exact details of the installation files were not made clear on the website. Note: Windows Version: XP, 32bit, SP3. I have not partitioned anything yet.

View 2 Replies View Related

Ubuntu Installation :: Dual Boot Win7/ubuntu With Ubuntu On Different Disk?

Nov 19, 2010

I have windows 7 installed on Disk2 (according to windows Disk Manager), and I installed ubuntu 10.10 on Disk0, choosing the dual boot option at installation.

However, grub does not load (presumably because its on disk0 and my machine appears to boot from disk3), so the machine goes straight into windows 7.

How do I get ubuntu to load?

View 2 Replies View Related

Ubuntu Installation :: New Ubuntu User Can't Load Ubuntu Or Windows

Oct 7, 2010

I'm currently running off of my live-cd, and after spending 4 hours of my life trying to fix this myself, i figured someone out here has to know how to help me. Basically, i wanted to try linux, then liked it enough to decide to put on one of my usb-drives (320g adata nobility NH92), and i couldn't get it to boot anything but windows w/o the live-cd, which would then boot the live-cd, lol, in other words, i couldn't get it to boot at all from the external, even though i had changed the setting in my bios to boot from usb first, and tried manually selecting boot from usb and all that fun stuff.

Sooo... eventually i decided it might be a problem with the bootloader, and while i'm not exactly sure at this point what i have done to my computer, all i can successfully boot is the live cd. When I try to boot w/o the live cd, whether i try to boot from my internal (windows) drive, or external, all i get is a device not found error.I think i could fix it if i had windows recovery cd's (i'm running xp, btw), or installation cds, but... unfortunately, they died in a terrible accident. So i have no cd's at all for windows. :/

View 3 Replies View Related

Ubuntu :: Upgrading To 10.10 - Error "select 'Ubuntu' In The Boot Up Menu Right After The BIOS Screen: Booting ' Ubuntu 10.10, Kernel 2.6.35-25-generic'"

Feb 13, 2011

I have been running Ubuntu 10.04 under Windows 7 (Is this call WUBI?) without any problems for a while. My other machines only run Ubuntu (9.04 & 10.04). I decided to give it a try to the latest Ubuntu 10.10. After going through the successful installation and then rebooting, I am getting the following error message once I select 'Ubuntu' in the boot up menu right after the BIOS screen: Booting ' Ubuntu 10.10, kernel 2.6.35-25-generic'

[Code]...

View 7 Replies View Related

Ubuntu Networking :: Ubuntu 2 Ubuntu Via Ethernet While Still Using WiFi?

Jan 26, 2010

I'm wondering if this is even possible. I've searched high and low and have yet to find and answer to this particular setup.

The setup:
Router is in another building.
Desktop connected by WiFi
Laptop connected by WiFi
Both the Desktop and the Laptop are in the same building together. About 5' apart.

SSH server is setup on Desktop
FreeNX client is setup on Laptop

So they can connect just fine via WiFi for remote desktop control of the Desktop from the Laptop (so SSH and FreeNX are working).Is it possible to connect the 2 pc's directly to each other by Ethernet cable AND transfer files between them by Ethernet while still being connected to the Internet by WiFi on them both?Or would the WiFi have to be disabled while using the Ethernet connection?Neither has a Gigabit Ethernet NIC so I know it would at least require a crossover cable or another router to connect the 2 by Ethernet cable.The idea behind all this is to be able to transfer files between computers quickly by Ethernet while the computers are still busy doing other things on the Internet by WiFi.

View 9 Replies View Related

Ubuntu :: Them Most Lightweight Ubuntu Or Ubuntu Based Distro?

May 11, 2010

I've been trying to find what would be the lightest ubuntu or ubuntu based distribution, I have an older PC I'd like to get up and running again, and would prefer something that works pretty quickly on it (for basic web browsing and other things) the specs are:

AMD Duron 900Mhz, 384MB RAM, 40GB HDD, Geforce FX 5200 128MB agp.

View 9 Replies View Related

Ubuntu :: Ubuntu Can't Override Previous Ubuntu Installations

Sep 19, 2010

1. I accidentally wrecked a previous Ubuntu installation so I decided to re-install via the Ubuntu disk. Unfortunately Ubuntu doesn't let me override previous Ubuntu installations...

2. Ubuntu Maverick Meerkat is due to released in about 3 weeks. I want to install it via a clean install.

3. So can anyone tell me how to remove both Ubuntu partitions safely. I am currently running WinVista with Ubuntu Lucid Lynx. I know I have to use something like this to erase GRUB2. Can anyone give me a good tutorial?

View 1 Replies View Related

Ubuntu :: Switching Betwean Ubuntu And Ubuntu Studio

Mar 14, 2011

I want to change from ubuntu 11.04 to ubuntu studio. Is there any way to do this without losing all my stuff/with out completely reinstalling the os?

View 7 Replies View Related

Ubuntu :: Connecting Ubuntu To Ubuntu Through VNC / Remote Desktop

Apr 19, 2011

The scenario is as follows - I will be moving across the country and my desktop will stay here powered and online, while I move with a laptop. I need a way to connect to the desktop for file streaming(music and movies) as well as using the virtual machines. I have thought about SSH and VNC.I need something failsafe. That's priority one. I won't be around to fix it if it breaks. I can set the computer to come on in the BIOS at a certain time if the power went out. But if I can get in remotely the whole setup is useless.SSH only provides terminal use, correct? So if I chose that route I would be able to access the computer via command line and play music and movies with mplayer and such, correct? But I would not be able to run the virtual machines? Because there will be no GUI, right?

I have been playing with Vinagre and Vino through the host and guest of a virtual machine and I cannot get it to connect. Is there a better application? x11vnc? I have forwarded port 5900 on the router and have upnp enabled. Got a better remote desktop suggestion?I would like to run this setup headless.(no monitor) I also would like to run it without a gpu if that is possible to make it more energy efficient.Both computers are 64 bits and will be running Ubuntu 10.10 and soon 11.04.Are these crappy ideas to begin with? Should I go another route to get my files and access the virtual machines?

View 4 Replies View Related

Ubuntu Networking :: File Sharing - Vista Can See Ubuntu - Ubuntu Cannot See Vista

Nov 24, 2010

After a reinstall of 10.10, I am able to turn on file sharing and so I set up a shared folder.

Windows Vista can see this folder but in my network place, there is only one icon, and it's a "Windows Network" icon. Upon clicking on that, I can see the local network, "Rompus Room".

When I click on Rompus Room, nothing happens for a while, then I get a message saying, "Opening "ROMPUS ROOM". Then I get the final message, "Unable to mount location", followed by, "Failed to retieve share list from server"

View 3 Replies View Related

Ubuntu Security :: Ubuntu Sudo Versus Windows 7 User Account Control

Jan 6, 2010

Is windows 7 UAC basically a user/system control system like sudo?

View 7 Replies View Related

Ubuntu Networking :: Not Connecting Ubuntu 9.10; Broadcom 4322AG 802.11a/b/g/draft-n WiFi Adapter?

Jan 13, 2010

I was running 9.10 in LiveCD mode and was unable to get online. Went to System>Administration>Hardware Drives and found "Broadcom STA wireless driver". Cool. So I went ahead and installed 9.10 (dual boot with Vista), repeated above steps but found no "Broadcom STA wireless driver" option, in fact no proprietary drivers. So I still cannot connect to the Internet, and I don't know where to go from here. (Note: I installed 9.10 side by side with Vista: good? bad?)

[Code]...

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved