Programming :: Cannot Prompt User In While-read

May 15, 2011

I'm facing a problem in a - at least I though it would be - simple BASH script. I use 'awk' to find matching lines in a file, and then use while-read to modify each line matching the expr casted in awk. It looks like this:

Code:

function foo() {
awk '$NF~/^./{print $NF}' FILE.TXT|while read line; do
bla bla bla ...

[code]....

However, each time the execution hits the 'read choice' line, it doesn't prompt - as well as pause the excution - the user for a choice: it just passes it. This problem just happens inside the while loop.

View 4 Replies


ADVERTISEMENT

Fedora Installation :: Boot Prompt Information Read Automatically From Isolinux.cfg Without User Intervention?

Oct 4, 2009

building an install cd or dvd media that will automatically install the Linux software on a client pc. There is no network connectivity so the client can only be loaded with Linux from CD or DVD media. The crux of the matter is that I can not automatically install the Linux software on client WITHOUT typing linux ks=cdrom:/ks.cfg at the boot prompt.

I want to avoid any user prompts and just have the software install with the RPMS that I need for this client pc at the boot prompt. Actually, when the boot prompt commences, I would like the software install to start with no user intervention. I've tried several different methods in isolinux.cfg, but the OS always wants boot prompt for the cdrom. Can the boot prompt information be read automatically from the isolinux.cfg with out user intervention? I'm looking for the same behavior as a LIVE CD that kicks off with no boot prompts after a few seconds. Here's a copy of my isolinux.cfg

default linux
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
[Code]....

View 1 Replies View Related

Programming :: Bash Scripting With Sudo / Password Prompt And Accepting User Input?

Jul 30, 2011

I'm creating a bash script to do some tasks for me. I would like the script to be run at a set time of everyday. My first question is if it is possible that if one of the commands in the script requires sudo, is there a way to get around it with out making sudo not require a password. Such as, is there a way to include the password in the script? If that is the case, I can always just set the file as read only by sudo. I've been looking for a way to do this, with no success. if I have a command that wants input, how do I give it to the program. For example, if I want to make a zip file that is encrypted, the command would go as:

Code:

zip -r example * -e

now how would I get the script to insert my wanted password.

View 14 Replies View Related

Programming :: Read Information About User Activity?

Jan 2, 2010

I wonder if there is any chance to read the last time when the actually logged user have changed the mouse cursor and stroke the key.

View 3 Replies View Related

Programming :: Bash - Read User Input: URLs Without The Enter Key Stroke?

Sep 23, 2010

Here's a challenge I've been struggling for months with:

I have a bash script that reads URL addresses of our internal server and then executes some test commands on them. Something like this:

Code:
read -p "Enter URL: " url
sh execute-what-ever-to $url

After copy-pasting the URL the user taps the enter key and the script proceeds, but here comes the tricky part: I want this to work without the need to press the enter key after copy-pasting the URL.

"read -n" does not work in this case, as the URLs vary greatly in length. However, the URLs always end to the same string. They could be like "http://url1/END", "http://url2/END" and so on. So this ending string "END" could be theoretically used to recognize that the whole URL has been pasted.

View 2 Replies View Related

Programming :: Bash Shell Read User Argument From Command Line And Test It

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

Programming :: Create A Simple Program With Will Continually Read Input From The User Until They Enter A Blank Line?

Apr 6, 2011

basically i have to create a simple program with will continually read input from the user until they enter a blank linei know how to read in certain input but not sure how to get it continually in a loop

View 2 Replies View Related

Ubuntu :: Cannot Read In The 1/4 Second The Error Lasts On Screen Before The Grub Prompt

Jul 14, 2011

This morning I ran an upgrade which upgraded the kernel from 2.6.35-28 to 2.6.35-30 on my Maverick system. I then departed for a meeting and came back to discover that my system had rebooted itself and only booted into an initramfs prompt.

Rebooting again shows a very brief flashing message of "error: unknown filesystem" alongside a few other errors I cannot read in the 1/4 second the error lasts on screen before the grub prompt. Neither kernel boot nor recovery mode options take me anywhere except to the initramfs prompt. I have searched and found a few threads on similar issues, but they all involve different fixes and suggest causes (such as dual booting on an ntfs drive, which I do not do) such that I am unsure where to go from here.

View 8 Replies View Related

General :: Read A Text File And Ftp Files Using Bash W/out Leaving The Ftp Prompt

Oct 9, 2009

I have a script almost working except for 1 thing. What I'm trying to do is read a file that has the files that need to be FTP'd using a bash script. I have everything working except the reading of the file. It works outside of the ftp script I've wrote but once I put it in the FTP script it doesn't.

Here's the Script:

#Here's where the problem is that I know of

I've been playing w/ the exclamation points to see if that could be the problem, but so far no luck.

View 6 Replies View Related

Ubuntu Installation :: (initramfs) Prompt After Alternate CD 9.10 With RAID - Grub Loading: Biosdisk Read Error

Jan 13, 2010

I am trying to install Ubuntu on a nvidia board which, based on the forums I have perused, is a FAKERaid chipset. Originally I tried to install according to https://help.ubuntu.com/community/FakeRaidHowto to no avail. I gave up and am resorting to breaking down my raid setup (thus losing my Windows XP installation) and using Linux's software raid (which seems to be the recommended method) with the Alternate CD install.

I went in to the bios and completely disabled my board's RAID function. I then followed the instructions here: https://help.ubuntu.com/community/In...n/SoftwareRAID , except it popped up with a window advising me "one or more serial ATA RAID configurations have been found. Do you wish to activate these RAID devices?" which that page didn't mention. I believe I selected "Yes". Setting up the partitions I made (from beginning of disk to end of disk) a RAID1 200MB /boot partition, a RAID0 / partition (90GB?), free space not set up in RAID (approx 20GB for each SATA drive to later install Windows on [if that's even possible]) & then the SWAP partition 2GB at the end of one of the disks (is it OK that this one wasn't in RAID?).

The installation completed, as far as I can tell, without a hitch. Except also of note: my network card doesn't work in the installer (gives an error message about unable to configure dhcp) so i'm not connected to the internet. Then I restart and the following appears: grub loading: error: biosdisk read error. Followed by what appears to be the Ubuntu loading splash (just a small white shape in the middle of the screen), and then:

[Code]....

View 9 Replies View Related

Fedora :: Prompt End User To Install New Versions?

May 30, 2011

Does Fedora Now Prompt End Users To Install New Versions? If so, what a terrible idea and how do I disable it? So, I get a late night call from one of the people I support with their PC. You know, the basic PC user who barely knows enough to be dangerous. I'm sure we all have friends like this, who we help out and keep Linux running for them. Anyway, he says Fedora prompted him to upgrade to Fedora 15 (from 13) and of course, he says OK. He usually says OK when fedora asks to update his software.

Now things are hosed, he can't get on-line and worst of all, he's running F15 with Gnome3 and can't find his way around or do the things he's used to doing. Why on earth would fedora prompt to upgrade to a new version via the net? (..btw - he said it took forever.. ) I'm sure this exact scenario will be played out 1000s of times and peeps like me will be wasting lots of time straightening things out after the fact. Seems to me Fedora should not prompt for full version upgrades. It's trouble waiting to happen and that kind of thing should be user initiated by someone who actually knows what they are doing, so as to avoid the scenario that just played out with me.

View 7 Replies View Related

Ubuntu :: Added New User But Can't See The Shell Prompt?

Apr 8, 2010

I just added a new user to my ubuntu by:

useradd -gdevelopers -d/home/peter -m peter

when peter logs in (after I created a passwd for him) he doesn't see the shell as I do:

me:
adhg@server:~$
peter
$

ALSO, he can't user the TAB to move inside a folder (when you type cs /home/p and use tab to get /home/peter)

View 2 Replies View Related

Ubuntu :: Prompt Disappears When Switching User?

Sep 6, 2010

My normal prompt looks like: username(at)ubuntu + current directory. (Odd format, it doesn't really look like that, but I was told I needed 15 posts to post an URL).Whenever I change user with "su username" (at least when changing from root to normal user), this prompt completely disappears. All it says on the left in front of the input "$". Also the history doesn't work, and the tab key doesn't complete anything, but rather acts as the normal tab in an editor. do I fix this? It is very annoying. Sorry for the stupid question, but I've searched around for an answer, finding none.

View 1 Replies View Related

General :: Run One Command As Different User Without A Password Prompt?

Aug 4, 2010

I need to run one command as different user with out a password prompt.

I did this

Code:
one localhost= (two) /usr/bin/whoami

This work but it prompts for password. Is there a way that can be done with NOPASSWD option ?

View 1 Replies View Related

Ubuntu :: How Is Super User In Authentication Prompt Determined

May 3, 2010

How is the super user determined for the dialog box that pops up when trying to perform administrative tasks, "An application is attempting to perform an action that requires privileges. Authentication as the super user is required to perform this action."? Does it always ask for the password of the default user created during the OS install, or should it prompt for the current user's password if that person is an administrator?I use likewise-open for windows domain authentication, so I typically log in as a windows user that likewise-open has added to the list of users on this system. I have given this user sudo access and added the user to all the same groups as the default user, yet whenever I perform an administrative task in gnome I am prompted for the password of the default user. Is this normal? It seems like the behavior would be to ask for the current user's password if that user is an administrator, and if so what determines that the current user is an administrator?

View 4 Replies View Related

Ubuntu :: Gnome Preference Dialog For Gdm User Prompt

Sep 14, 2010

I have one Ubuntu 10.04 machine that is configured this way.I want GDM to prompt the user to enter their username via a text field, and then a password, instead of displaying a list of users to choose from.One way to configure GDM's appearance is to run the following from a terminal: gksudo -u gdm dbus-launch gnome-appearance-properties.If I remember correctly, there is a different dialog to run than "gnome-appearance- properties" that allows changing whether GDM prompts for a username or displays a list. But I do not know what it is.

View 2 Replies View Related

Ubuntu :: User Settings Doesn't Prompt For Authentication?

Aug 15, 2011

when I click on "Users and Groups" the dialogue box shows up, but I'm unable to make any changes because I'm not prompted for authentication (the "add", "delete" etc., buttons are grayed out). I'm using 10.10.

View 2 Replies View Related

General :: F1-F6 Console Doesn't Prompt For User/password?

Apr 21, 2011

I'm running Debian Wheezy and I don't know why, but whenI switch to console F1(Ctrl+Alt+f1) I can't enter login information. It's like Debian didn't have completely starting and wait always.The F1 console looks like this:

[screen content]
Starting enhance syslogd: rsyslogd.
Starting system message bus: dbus.

[code]...

View 9 Replies View Related

General :: Ubuntu 10.04 - Change System Display User Name On Prompt?

Sep 22, 2011

Choose Menu System->Administration->Users and Groups

I am able to see my Users Settings as follows:

User name: mike

Then why I still see the following prompt line? code...

If my understanding is wrong, then how can I change it in this way?

View 1 Replies View Related

General :: No Password Or Username Or Grub Prompt On Ubuntu Mac User?

Jan 30, 2010

I have bought a Mac Laptop however it has a username and password which I don't know. I've looked all over to see how I can overcome this lot's of people have said to enter at Grub prompt to take you to recovery, however I have no Grub prompt and Mac is not booting from cd rom.

View 1 Replies View Related

Ubuntu Security :: Scripts Or Applications Cannot Install Without The 'sudo' Prompt And User Input?

Feb 12, 2010

Would it be safe to say that if I build a restricted user: "Desktop" or "unprivileged" user I will be ok? From what I understand - most scripts or applications cannot install without the 'sudo' prompt and user input.

View 8 Replies View Related

General :: No Prompt For Root Password After Attempting To Enter Single User Mode?

Jul 13, 2011

I followed instructions to enter single user mode by adding single at the end of kernel line but after that it doesn't ask for root password but brings up the sh# prompt. Isn't that supposed to be insecure? I understand for this the grub password can be applied but even after adding "single" it should ask for root password..or it should not..??

View 3 Replies View Related

Programming :: SSH With No Password Prompt?

Apr 19, 2010

I'm writing a script which will log into a list of servers if they have public/private keypairs set up. If a server doesn't, I want the script to move on to the next server rather than wait at a password prompt.I'm using OpenSSH version 5.1p1 Debian-5, OpenSSL 0.9.8g 19 Oct 2007 on both client and server.I'm using this command: Code: ssh root "at" "IP" -o PasswordAuthentication=no KbdInteractiveAuthentication=no I had to write "at" instead of the symbol, as I'm not allowed to "post URLs to other sites after you have made 15 posts or more."This works for most servers, but not all (on some of them the script halts at a password prompt). I suspect those servers may run an older version of SSH which doesn't support the options I'm providing

View 3 Replies View Related

Programming :: Timer In Socket Programming - Wait For X Sec After Read() And Then Disconnect The Client Connection

Mar 8, 2011

I have a server listening on incoming client connections. Once the client establishes SSL connection with the server, the server waits on read() from the client. Only Client can disconnect the connection. I want to have a timer in the server program to wait for x secs after read() and then disconnect the Client connection.

View 3 Replies View Related

Programming :: Change The Prompt Of Shell Through C?

Oct 30, 2010

I have an assignment that I have to change the prompt of shell through C.

View 11 Replies View Related

Programming :: Prompt For Some Information From PAM Module?

Jan 8, 2011

I'm writing a Plug-gable authentication module for ssh. I am looking for prompting for some extra information after user name and password verification but before giving access to user.Actually after SSH I want to extend the same for some other services. So I am looking at some PAM module level suggestion.

I tried using conversation method with message style=PAM_PROMPT_ECO_ON but it results in PAM_CONV_ERR and conversation fails. Is it right way to interact or please suggest me If I'm doing wrong somewhere. When I use message style=PAM_PROMPT_ECO_OFF communication succeeds but message is not shown and interaction doesn't happen.

I've pased the sample code I've written at url.

Code:
#include <sys/types.h>
#include <string.h>
#include <pwd.h>
#include <grp.h>
#include <syslog.h>
code....

View 3 Replies View Related

Programming :: Send A Message From IP To Another IP Through Command Prompt?

May 24, 2010

I want to send a message from IP to Another IP through command prompt. how can i do this.s

View 3 Replies View Related

Programming :: Init.d Script Does Not Return Prompt?

Jul 9, 2010

I have an a script in /etc/rc.d/init.d script that I would like to start and stop my sample application. I have named my script "foo", then I can start running my application my typing $ foo start but this does not return [OK] like other scripts do and does not return to shell prompt. My application is basically like this

int main()
{
do {
printf("Hi
");
sleep(1);
} while (1);
}

What is missing from my application that prevents from returning the shell prompt?

View 3 Replies View Related

Programming :: Virtual Accounts - Changing The Prompt?

May 21, 2011

I need to write a bash script that will allow me to manage my "virtual network" (in reality just a bunch of directories and files). I need to obtain something like : I have my own command 'connect'. We can use it in two different modes: user and admin.If I type 'connect adashiu virtual_machine_name, computer will ask about password, if password is correct he will change a prompt to :

adashiu_at_virtual_machine_name >

after that user can start to use commands reserved only for user mode.Analogically with admin mode: prompt 'admin >' and administrator can only use bunch of commands reserved for him.

View 1 Replies View Related

General :: Setup A Read Only FTP User?

Oct 19, 2009

Hello, I'm trying to set up a read only FTP user; basically, they have the ability to browse a particular images folder and download, but not write (or delete accidentally). I've got it set up so the FTP user logs in directly to the folder, so I'm good with that; but they still have write permissions. We have an application built in PHP that copies image uploads to this folder; it also resizes them in the same folder. So in addition to the main FTP user (me) who needs write access to this folder, whatever the Apache/PHP user is (not sure?) also needs write access. Is there a simple way to affect read/write permissions on a user level?

View 4 Replies View Related







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