Software :: Shell Script Using An If Statement And "wall"?

Apr 17, 2011

made a simple script called "msg" to make it simpler to use the "wall" command, but it is giving me some issues. The problem is more cosmetic than performance, but it's annoying.OS:Ubuntu 10.10 Text Editor: Nano (Probably not important, but hey...)Here's what I got:

Code:
#!/bin/bash
# Changes color to yellow

[code]...

View 4 Replies


ADVERTISEMENT

Programming :: Shell Script For Adding A Statement In A File After A Particular Statement?

Jun 28, 2010

We are building our C++ project in Kdevelop IDE. Every time we run "Run Configure" from the "Build" menu, a file named "libtool" gets automatically generated. This file contains a statement as "ECHO="echo"".f we run "Automake", without modifying the "libtool" the system hangs and theputer needs to be restarted.Therefore every time we run "Run Configure" we need to include the line "echo="echo"" below the statement "ECHO="echo"" manually.I think a script can be written which does the above on its own.I am not a shell script programmer, I know the good tutorials for shell scripts are available on the net, but learning scripting only for this task would be time-consuming and painful.

View 4 Replies View Related

Programming :: Ignore Case In If Statement Shell Scripting

Feb 3, 2010

How do i make my strings case-insensitive while comparing them with an if statement?

View 2 Replies View Related

General :: Script (Case & IF Statement Syntax) - Easy To Answer If Know Shell Scripting

May 6, 2011

Im a bit stuck with a simple script that im practicing with... im trying to get my head around some simple scripting. Basically i want to write a script that will work as below: It will ask the user to enter their userid. If its correct it will say 'Correct' If its the wrong id (But the ID exists in /etc/passwd) then it will say 'incorrect' If its not a valid userid it will say 'doesnt exist'. What i have so far is:

[Code]...

# If the user enters their own userid they will get a comment saying 'correct' $LOGNAME) echo "Correct";;

# If they enter another users ID (That exists in the /etc/passwd), then they get a message to say 'incorrect userid used'. Im not sure what i need to do here to get it to check the /etc/passwd to see if the input exists in there.... im guessing some kind of simple 'if' statement to say ---- "if 'input' exists in /etc/passwd then echo "incorrect userid used"

# If its entered incorrectly and not a valid ID then they will get this comment. Again, im guessing this part would be similar to te above option..... *) echo "not a valid ID";;

Ive managed to work out how the basic Case staements work, but to add a conditional statement based on the input, i just cant figure out. I have tried looking on google, and found some help but it doesnt really explain how i check the input against the /etc/passwd.

View 17 Replies View Related

Programming :: Perl Switch Statement Throwing Error Like Bad Case Statement (invalid Case Value)?

Oct 6, 2010

I've written a simple perl code to learn switches in perl.My code is pasted below,

#!/usr/bin/perl
$opt = 1;
switch($opt) {

[code]...

View 3 Replies View Related

OpenSUSE :: Any Other Options For Fire Wall Gui

Aug 11, 2011

Are there any other options for a fire wall gui for opensuse where you can see exactly what is going on with the firewall? I am finding the yast firewall gui in opensuse 11.4 to be extremely limited. I am not proficient in ip tables so looking for something that would give better control over the firewall rules for a beginner.

View 1 Replies View Related

Ubuntu :: Add Viewports In Desktop Wall?

Mar 1, 2010

i have enbled desktop wall in compiz. problem is, it seems that i only have two viewports available (left and right), whereas i see viewports way more than two in screenshots and videos videos. how do i go about this?

View 1 Replies View Related

General :: How To Send EOF To Wall Cmd In Script?

May 21, 2010

How do you generate the end of file character so that you can send it to a script.

View 4 Replies View Related

Ubuntu :: Certain Facebook Wall Show Up On One Of The Pages?

Dec 29, 2010

I'm in the middle of creating a new web page & want to have a certain Facebook wall show up on one of the pages_[ Is this possible & if sooo how can I accomplish ]

View 2 Replies View Related

Ubuntu :: Multiple Wall Paper Backgrounds?

Apr 28, 2011

is there a way to get multiple background wallpapers in unity, if so how

View 3 Replies View Related

Software :: How To Monitor Wall Outlet With Nagios

Oct 20, 2010

Is there a way to monitor a wall outlet with nagios.I want to check if we got some power out of a wall outlet.This is to check whether we are running on the electricity network or on our diesel power generator.The wall outlet is connected only to the electricity network, so if there is no more power coming out of the outlet that mean that we are running on the diesel power generator.

View 2 Replies View Related

Fedora :: Script To Change Wall Paper Every 15 Minutes?

Jun 27, 2010

I've tried and tried to get crontab working. its just a simple script to change my wall paper every 15 minutes.

i do
crontab -u Josh -e
*/15 * * * * /home/Josh/.splatter/splatter

[code]...

View 2 Replies View Related

Fedora Hardware :: Running Into Wall Getting Wireless Working

Aug 26, 2011

It's an acer Aspire One D257-13478.Download the correct firmware and tar it into the appropriate dirctories and I'm still running a wall.I don't know how to get the b43/b43legacy in the lsmod list.I've also tried use the rfkill command and using yum to install it gives me this response:"cannot retrieve repository metadata"
I also went into the F2 setup menu and couldn't find anything to alter the bios wireless.After installing Fedora 15 almost all the drivers remained intact including enumerators for usb mice.I don't know what's going on.

View 7 Replies View Related

Ubuntu Servers :: Trying To Get Cups To Work Beating Had Against Wall

Oct 17, 2010

I can't access the web interface for cups to install a printer on Ubuntu server 10.4 tell me how to get it working right or i'll just throw the computer out the window and go with windows server, a much better, user-friendly product, like all Microsoft creations

View 1 Replies View Related

General :: Send Color Message To All Users With Wall?

May 21, 2010

How to send color message to all users with wall.

View 1 Replies View Related

Server :: Broadcast A Message To Different Computers Using Wall Command?

Feb 4, 2010

With wall command, we can just broadcast a message to all the login users in only system, how to broadcast a message to all the systems which all are in same network

View 4 Replies View Related

Ubuntu Networking :: Banging Head Against Wall- How To Setup Wifi On An Inspiron 9300?

Feb 24, 2010

I've had 8.04 for almost a year & a half now, but the one thing that seems to confuse me after getting the rest of ubuntu is how to get wifi working. Before you say "read XXX FAQ, wiki, page", etc, I've read so many and despite understanding every normal thing about ubuntu, and all the customization I have, I haven't seen a single, up-to-date guide for making sense of wifi.

Here's what I know:

My wireless card is Network controller: Intel Corporation PRO/Wireless 2915ABG Network Connection (rev 05), supported in linux only by using a windows driver, ipw2200, which I do have running and installed somehow.

Code:
shogun@Valhalla:~$ sudo lsmod | grep ipw2200
[sudo] password for shogun:
ipw2200 146248 0
ieee80211 35528 1 ipw2200

I also realized I needed ndiswrapper, so I installed that. Beyond this, I'll just admit it- I'm very confused. I have always had a working connection over ethernet cable plugged in, but I really need wireless lately, and found an old Netgear WGR614v7 G band wireless rounter in my basement, hooked it up, and have a wired connection from it right now.

So how do I set-up/get my wireless working with all this thus far? How do I set up the router's network through Ubuntu as well, so I can create a named network to connect to? I'm reading every guide I can, and am just coming up more confused.

View 9 Replies View Related

Ubuntu :: Error - O-strict-aliasing -MD -Wall -Wpointer-arith -Wstrict-prototypes

Apr 23, 2010

regarding the below error :

o-strict-aliasing -MD -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs miniglx.c -o miniglx.o
In file included from miniglx.c:9:
../../include/GL/glx.h:296: warning: function declaration isnt a prototype
miniglx.c:222: warning: no previous prototype for glXGetProcAddressARB cc -c -I. -I.. -I../../include -I/usr/include/directfb -D_REENTRANT -D_HAVE_FULL_GL=1 -march=i686 -O3 -fno-strict-aliasing -MD -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs miniglx_events.c -o miniglx_events.o

[Code]...

View 1 Replies View Related

Software :: Increase The Accuracy Of Function Get_rtc_time() - Get Time Of Wall Clock From Wireless Driver

Oct 24, 2010

I am trying to get the time of my wall clock from my wireless driver in form of "hh:mm:ss", so I used the function get_rtc_time() inside my driver to get that and it was done. My question: Is it possible to increase the accuracy of this function, for example if I want to get the milliseconds and the Microseconds in additional to the first output? If not, Is there any other function can do that?

View 3 Replies View Related

Ubuntu :: How To Create Path Statement

Aug 7, 2011

I have multiple drives and software that defaults to my primary drive. I want to change preferences to use my second drive.This is the current path "/home/guy/dvdrip-data" my second drive is named "2Internal".How do I properly format the path statement to use the second drive?

View 7 Replies View Related

Programming :: Script With Variable In If Statement?

Jul 9, 2010

I am trying to create a script to be used on RHEL server. If I replace the $t with a number, the script works. If I try add a variable or the $1, the script doesn?t work (returns all processes even if less than the $t value). I thought that it may be treating it as a literal, but I wasn?t sure of the conversion.

t=$1
echo $t
lcnt=`ps -eo pid,ppid,rss,vsize,pcpu,pmem,cmd -ww --sort=pid | awk '{if ($6 > $t) print

[code]...

View 2 Replies View Related

Ubuntu :: Syntax Error On Done Statement

Nov 28, 2010

I have returned the below mentioned lines of code however I am receiving error "Syntax Error On Done Statement".

while:
do
clear
echo "-------------------------------------------------------------------"
echo "Main Menu"
echo "-------------------------------------------------------------------"
echo "[1] Today's Date"
echo "[2] Show files in the current Directory"
read yourch
case $yourch in

1) echo "Today is `date`,press a key ........";read;;
2) echo ls -l;read;;
*) echo "Select the yourch as 1 or 2";

View 3 Replies View Related

General :: Cd Inside If Than Statement After Fi Back To Old Dir

Jul 12, 2010

the script below prints the pwd of where I want to be. after the fi it puts me back at the original dir. just writing these scripts to understand what's going on.

#! /bin/bash
if
[ -d mydir ]
then
cd mydir/ && pwd
fi

View 4 Replies View Related

General :: If Statement With Multiple Tasks?

Feb 2, 2011

I want to have an if statement that does multiple things:

Code:

if [....] ; then
1=...
2=...

[code]....

View 3 Replies View Related

Programming :: Using If Then Statement Directly In Bash

Aug 12, 2009

When you use an if statement directly in bash you have to put the ";" at the end or not? or am I mixing it with the for loop? I am reading advance bash scripting and it shows the if - then statements without ";" so I need a little clarification here.

View 2 Replies View Related

Programming :: Put All The HTML In A Print Statement?

Sep 14, 2010

I have a site which will have, for example, a login system where people have to enter their usernames and passwords, depending on which they'll be let in to the site. So, in code, I've got a line like:

if ($_POST['password'] == $password) {
then do whatever
}
else { print "Wrong password" ; )

My problem is, this "Wrong password" printing is just a solitary line, not keeping with the colours and style of the site, and it looks very bad. I want to ideally, output some HTML, which will have a picture, and print the "Wrong password" in the font and colours I desire. Do I have to put all the HTML in a print statement, and then deal with the nightmare of escaping all the quote marks in it with a ""? Or is there a cleaner method to the whole thing? Maybe something like this -

if ($_POST['password'] == $password) {
then do whatever
}

[code]....

View 4 Replies View Related

Programming :: Code Sql Statement For Use In PHP Script

Sep 21, 2010

I'm trying to code a sql statement for use in a PHP script.I'm looking to find the number of matching records in two tables and display them.How would you write that statement.I've tried using count a few ways, but no cigar.

View 2 Replies View Related

Debian :: Find & Modify Path Statement

Jul 19, 2011

I am running Debian Squeeze, 64-bit.I would like to try my hand at bash scripting. So at the author's suggestion (first chapter of Chris F. A. Johnson, Pro Bash Scripting from apress) I created a /bin directory in my home directory. So now I would like to modify my PATH statement so that when I run a script from my bin directory my shell will find it.I did that. He then says that I should add this to ".bash_profile, .bashrc, or .profile depending on how bash is invoked." The find command is unable to locate any of these files. So I searched the forum, found the link above and tried to follow that. No luck so I assume that how Debian handles PATH statements has changed since that post?

I also have checked the wiki and worked Google as hard as I know how to do.Very simply where the heck is my PATH statement and how do I modify it?

View 4 Replies View Related

Ubuntu :: BASH Script: Odd Output Near IF Statement?

May 31, 2010

For some reason, I get said block of errors when I run my script without arguments:

Code:
/home/mark/bin/backup: line 34: [: =: unary operator expected
/home/mark/bin/backup: line 37: [: =: unary operator expected

[code].....

View 5 Replies View Related

Ubuntu :: Installing Bank Statement Decoder?

Sep 5, 2010

My bank statement s get delivered via email but they require a special decoder to be read. I got the decoder here [URL].. (the gui version), extracted it and tried to install it but the terminal gives me the following message:

bigseb@bigseb-laptop:~/Documents/reader$ sudo rpm -i /striata-reader-1.0-27-linux-2.4-intel rpm: please use alien to install rpm packages on Debian, if you are really sure use --force-debian switch. See README.Debian for more details. bigseb@bigseb-laptop:~/Documents/reader$

View 9 Replies View Related







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