General :: Answer "Enter Your Coice: [1-3]" Via Shell Script?

Jan 19, 2011

I have a problem in my shell script. I try to control an installation.During the installation there are a few questions which have to be answered.Like: "Enter your Choice [1-3]: "I want do something like this:

--> It's my first script <--
#!/bin/bash
echo "--> Install packages <--"

[code]....

View 4 Replies


ADVERTISEMENT

Server :: DNS In Centos - Enter Ip Or Address Nslookup Does Not Reply Any Answer

May 5, 2010

When i enter ip or address nslookup does not reply any answer. It shows no server found. "servfail". This is my named.conf file:

[Code]....

View 3 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 :: C/C++: Broadcast Receives No Answer - Can't Find Right Answer

May 18, 2010

How can I set the outgoing port for the socket? In wireshark, my outgoing port is 1024, and i want to set it to 6800 (or a similar port) I see the outgoing broadcast-message in wireshark, but no answer. There are three ECU's in the LAN, which should answer. The following code is a mixture of C/C++ and jointed from different articles:

[code]...

In wireshark I can only see the outgoing message. But the "recvBuffer" (in the lower part of the code) contains the same content as the sendBuffer. Is it right, that I need a sender and further more a receiver? Or should I receive the broadcast-answer on the same socket on which I send the bc?

View 5 Replies View Related

Ubuntu :: Passing Enter To Shell Script

Apr 26, 2011

I want to write a script that runs ssh-keygen command and when it prompts for input, the ENTER key code is passed automatically for all questions.

For example consider this:

Code:

I want to automatically pass ENTER to the questions. What should I do?

View 6 Replies View Related

General :: Unable To Enter Password In Terminal To Enter As Root

Jun 11, 2010

Succeeded in connecting to internet using my wll phone. I can now connect using 'wvdial' command in root terminal. But I want to connect through terminal. I tried 'sudo wvdial' command. Then I am asked for my password. But I cannot type my password there. When I type, nothing appears on the terminal window. Ofcourse there's no problem with my keyboard.

View 5 Replies View Related

Ubuntu :: Will Not Finish Booting - Press Esc To Enter Recovery Shell

Jan 22, 2010

I have never in a year had a problem with this d-boot system. Two days ago I tried to boot into ubuntu like every day. It started to load normal, went to the ubuntu logo and paused for about 15 seconds and posted this under the logo:

One or more of the mounts listed in /etc/fstab cannot yet be mounted
/: waiting for /dev/loop0
/tmp: waiting for (null)
/boot: waiting for /host/ubuntu/disks/boot
Press ESC to enter a recovery shell

I have looked everywhere and tried so many things, I can't look any further. All I have been doing for two days is trying to boot this system.

View 8 Replies View Related

General :: VPS Does Not Answer Any DNS Request?

Feb 7, 2011

I have a VPS CentOS 5.5 32 bits. It does not answer any DNS request made to the server.

I need to configure Bind to answer these requests.

I have been reading about that for several days and here: [URL]

But it is uncompleted.

I need to configure these too:

chroot DNS with BIND avoid cache poisoning avoid being an open resolver port randomization

I have found several tutorials but all of them have different points of view.

I am looking for a good tutorial that has everything:

Setting up bind on CentOS 5.5 chroot DNS with BIND avoid cache poisoning avoid being an open resolver port randomization configure iptables for bind

View 3 Replies View Related

General :: Automatically Answer 'Yes' When Using Apt-get Install?

Jul 16, 2010

Is there a way to make apt-get install answer "yes" to the "Do you want to continue [y/N]?"?

View 5 Replies View Related

General :: Can't Get An Authoritative Answer From A DNS Server

Apr 23, 2011

When I type 'nslookup some site',the result I always get is a non-authoritative answer. How can I get an authoritative answer?

View 3 Replies View Related

General :: How To Auto Answer Fsck During Boot Up

Dec 27, 2010

I wanted to know how can I make fsck automatically fix HDD errors when it needs to check HDD during boot up and do not ask user for it . I found some of fsck related scripts in /etc/init/ and /etc/init.d/ but I don't know what to do with them.

View 7 Replies View Related

General :: Check When A User Was Created,but Got No Answer?

Jul 14, 2010

tried a lot to get an answer for howo check when a user was created,but got no answer. know the command or how to check when a user was created?

View 14 Replies View Related

Fedora :: Terminal Won't Let Enter Password After Enter Sudo Command ?

Jan 12, 2011

I am pasting sudo commands without problems as a user (ales in my case) and then immediately the ask the user password.

The keyboard seems to be dead, no keys work, not allowing me to enter the password.

View 6 Replies View Related

General :: $HOME/.bashrc Disabled When User Shell Is 'rbash' (restricted Shell)?

Jun 15, 2011

MACHINE: HP Proliant DL260G5OS: SLES 11 SP1kernel: Linux xserver 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/LinuxIt is used as remote xserver in a LAN.I have configured /usr/lib/restricted/bin/.rbashrc with some environment variables but when the users logon in the system finally is executed $HOME/.bashrc and some environment vars are overwritten.

View 2 Replies View Related

General :: Write A Shell Script Instead Of Shell Function?

Apr 27, 2011

I would like know when it is necessary or advisable to write a shell script instead of shell function ?

View 3 Replies View Related

General :: Open A New Shell From A Shell And Switch Between Them?

Jan 18, 2011

I am wondering if I can open a shell or new terminal thing from within the terminal in a unix/linux enviroment. Particularly a commandline only one where there is no GUI. Is this doable? how do I do it?

View 3 Replies View Related

Ubuntu :: Can't Seem To Find Answer?

Aug 23, 2010

I've been googling around and can't seem to find my answer. I've got an old ATI 9700 pro that I'm removing from my system. I'm replacing it with an Nvidia GeForce 6200. What do I need to do to switch these in Karmic? I tried switching the cards, but I only get a white screen with the pointer on the new card. I can't do anything else. I'm guessing I have to uninstall the open source ATI driver first. How do I do that?

View 1 Replies View Related

Debian :: The Ssh Answer Is Too Slow?

Mar 2, 2009

When I connect to ssh server ( server running Redhat ) from debian it takes a long time to give me the prompt, while I receive the prompt rapidly when I connect from slackware or solaris?

View 9 Replies View Related

Fedora :: Sed Can't Find Related Answer For?

Aug 30, 2010

I'm trying to sed out X and Y coordinates from a identify command. I get back from the identify:

Quote:
1015x638+0+0
I need:
Quote:
1015x638

[Code]...

View 7 Replies View Related

OpenSUSE Wireless :: Gobi2000 Does Not Answer

Sep 5, 2011

system:
Opensuse 11.1 with custom kernel from Kernelorg and KDE3.5

Code:
uname -a
Linux linux-2c5j 3.0.4-41-desktop #1 SMP PREEMPT Sun Sep 4 18:51:01 CEST 2011 i686 i686 i386 GNU/Linux

The device is correctly visible:

Code:
lsusb
Bus 002 Device 003: ID 05c6:9204 Qualcomm, Inc.
Bus 002 Device 002: ID 8087:0020
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 046d:c012 Logitech, Inc. Mouseman Dual Optical

[Code].....

The modem responds with O.K if interrogated in kppp but the response on AT are not there. It does not dial. The modem has been installed as dev/tty/USB0I did compile Gobi loader 0.7 and it did run make and make install without error. The gobi rules are correctly installed and I did copy the firmware in the respective directory. The problem is: did I copy the right firmware? Is there some other problem. How can I diagnose if the firmware is the correct one (I unpacked the windows ones on a windows machine and there are 6)? I do not see usb0 offered by networkmanager (the network traffic is regulated through networkmanager).

View 6 Replies View Related

Ubuntu :: Can't Find A Clear Answer?

Nov 5, 2010

I've done a bit of googling, but can't find a clear answer on this. If I format a USB drive using NTFS, so I can store copies of files from my Win 7 machine and my Lucid machine, will it work.

View 9 Replies View Related

Programming :: C++: Broadcast Receives No Answer

Dec 22, 2010

It could run on my computer. But there is no result.

[code]...

View 1 Replies View Related

Ubuntu Servers :: Configure DNS To Answer IP Of Eth3?

Feb 11, 2010

My test box is running 9.10 desktop,bind,dhcp,LAMP. Everything is working good, except for one thing. How do I configure the DNS to answer the IP of eth3 (192.168.0.2), no matter what the client asked for? If you ask my DNS for google.com, I want it to return 192.168.0.2. I know this can't be that hard, I just can''t figure it out.

View 4 Replies View Related

Server :: Getting Modem To Answer On The Correct Ring

Aug 2, 2010

I am having issues getting the modem it the dial-in server I have set up to answer on the correct ring. I have the /etc/inittab set:

Code: S1:2345:respawn:/sbin/mgetty -n 7 -x 6 -D ttyS2 yet I have to play with 'init q' and minicom to get it to answer on ring 7. Then a reboot destroys the setting and I have to go through the whole hassle again and it goes back to answering on the first ring.

This is not acceptable. This dial-in server is only a very back door into my network. It is only turned on when needed. Most of the time it is not powered up. When it is turned on it is by a non-tech person with out the ability to jump through the hoops to get it to answer on the correct ring.

Ideally I want this modem to just listen to the line after it stops ringing to check for a data signal and if it does not find it just hang up. If it finds a data signal then establish a connection and all that. That way it does not interfere with answering machine on the line. Google has yielded very little info about setting up dial-in servers. Modems are not used very much any more.

View 4 Replies View Related

Programming :: Atoi() Not Giving Correct Answer?

Jun 20, 2010

i m using atoi() to convert char value to int. and then passing that int as a swtich variable.switch goes in a case and exectuing that particualr function but returning 0 value....for example: i am finding no of process() and system up time().when switch program goes in system up time it gives right values means correct no of days, hrs , min and sec but when it goes in no of process() it gives 0 answer.

View 8 Replies View Related

CentOS 5 :: Unable To Find An Answer To Yum Segfaulting?

May 15, 2010

I have been looking for a while and I am unable to find an answer to yum segfaulting.

I have tried:
yum clean all
rm -f /var/lib/rpm/__*
rpm --rebuilddb

I tried upgrading yum and rpm to the newest versions in 5.5 and I still run into the same problem.

fcntl64(6, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfcaf694) = 0
fcntl64(6, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfcaf694) = 0
fcntl64(6, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfcaf694) = 0
access("/var/cache/yum/base/primary.xml.gz.sqlite-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat64(6, {st_mode=S_IFREG|0644, st_size=20480, ...}) = 0

[Code]...

View 9 Replies View Related

General :: How To Enter Value On A Specific Line

Feb 18, 2011

I am starting to learn shell programming, but I couldn't accomplish a simple thing that can be done with sed, awk.Its simple, I am dynamically getting an IP number, and a rule name, that I need to save them on a single file on a specific line number.I found how to enter a value on a specific line, but couldn't understand how to enter the second value.

View 3 Replies View Related

General :: Bash Will Not Allow To Enter Tcsh?

Apr 1, 2011

I'm so lost it's difficult to even pose my question. My default shell is bash; and I'd like [actually, required to] have the ability to type csh and enter the TC shell...but it's not working at all. All the changes I made to the ~/.bashrc file work great, but I can't seem to access tcsh to see if the commands in my ~/.tcshrc file work.

When I type "csh", my old PS1 [prompt] displays and I have to type "exit" to get back to the one in the bashrc file and then type "bye" to log out off the system.

I've spent the last 3 days researching this, but every article/blog/site discusses permanently changing my log in...NOT going to happen.

View 7 Replies View Related

General :: Enter To Desktop Through Terminal?

Aug 28, 2010

i have problem in terminal (Ubuntu 9.10)

how can i enter desktop from terminal ? i typed " Cd desktop " but the result is Cd : command not found

View 7 Replies View Related

General :: Ksshaskpass - Don't Enter Password Always

Nov 5, 2010

i installed ssh on my fedora 13 running KDE and checkout some svn repositories via svn+ssh. Everytime when access my working copy, i am asked for password by ksshaskpass dialog box. I dont want to enter my password always. Can i disable it?

View 1 Replies View Related







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