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
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.
When Linux ask for my password in command line,my keyboard becomes unresponsive just for that moment or let me put it this way,until i need to write my password my keyboard is unresponsive,but for all other things is fine.or for example,i can input my password when i have a graphic interface but i can't with command line or i can't login to my computer from command lineexcuse me if my question is doll,i moved from windows to ubuntu just lastweek,( & i am flying high in sky with ubuntu & digging a very deep hole for windows too!!.)
I have an executable with input options, like so: Code: ./executable -n 42 -s 42 I've added gcov to the makefiles (compiling with --coverage, -fprofile-arcs, and -ftest-coverage, and linking with -lgcov). It builds fine and creates executable.gcno.
When I try to run gcov, gcov things the options belong to it: Code: $ gcov ./executable -n 42 -s 42 gcov: invalid option -- 's' Usage: gcov [OPTION]... SOURCEFILE... When I use quotes this happens:
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:
zip -r example * -e
now how would I get the script to insert my wanted password.
At the moment I have a flat file which is being used by a few people. I want a script to remotely change the file, so I can start logging who is doing what.At this point here is one requirement I am trying to develop. We have text blocks who pretty much look like.I hope this is somewhat clear. I try to find $param for the right $workflow and change that. Can you help me to find $$var3 and change that?
Was wondering if any perl guru's could help me with a quick log file adjustment. I have a text file that looks like so (tabs and newlines are revealed so you can see what separates the data):
There are maybe 100 lines of text in this file at any given time. I need to delete all duplicate lines only looking at the first bit of text prior to the first tab. It doesn't matter which one gets deleted as long as there are no two lines that begin with that same text at the beginning before the first tab. So in this example, either the fist line "1234" or the last line "1234" would need to be deleted. I already have code in my script that opens the files - I just need the code to read the text into an array and the part that would find matches based on the above criteria, and make the deletions.
If it would be easier, I can even do a system call and use SED (v4.1.5) and/or AWK (3.1.5) instead.
i want in the website they ask to enter some input.Code:echo -e "<p>Please Enter Year : c</p> "read Yearif i use this command it will ask the user to enter year in command. but what i want is they ask the user to enter year in web browser.
I'm in the process of configuring a "guest" account for houseguests tose my computer. I've got the file permissions set, but I'd also like to restrict their access to the terminal. It seems to me that most of the damage that can be done to a computer goes through the terminal.I downloaded Pessulus (I use Gnome)but it doesn't require a password. the profiled user can just open Pessulus and alter their profile -- what's the point?Is there a way I can require a user to enter a password, either for any terminal or Pessulus?I like Pessulus -- it's concise and easy to use. But it doesn't seem very secure as I understand it.
I have installed the new phpMyadmin3.4.1 on a server running Ubuntu 9.10 with apache and mysql. It runs on php5.2.10The apache config seems fine as the virtual directory that I configured works fine. http://<ip-of-server>/phpmyadminlink works. The home page is displayed. But when I enter the user name and password, instead of logging into the console, it again redirects me to the index page of the site. There are no errors displayed. I have checked that cookies on browser are enabled.The server is hosted on amazon web services, if that makes any difference
and I get this error simply running the program from the command line: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at ./submit.cgi line 24.
is this the right syntax to use, both, for this line:
my (@param) = $cgi->param("firstname","lastname","type") ;
as well as this one:
$sth=$dbh->prepare ("SELECT firstname,lastname,type FROM dts WHERE firstname LIKE $param AND lastname LIKE $param and type LIKE $param" );
or should there be quotes around the $param or something? (also is it $param or $param(0)?)
I need write a script that can compare multiple input files and output a file. The basic idea is:1: All my input files are in the same format2: I want to find in-common lines (in-common 1) from some of my input files (e.g., input1, 2 an 3), and find in-common lines (in-common 2) from the rest of my input files (e.g., input 4,5,6,7). And then, compare in-common1 and in-common2 and remove any overlap from in-common 1.3: Output the remaining in-common 1 file after removing any of its overlap with in-common 2I know how to write this script by putting all the filenames in one script and compare them. But the thing is, if I have more input files, such as 100, it might not be that efficient to write all filenames in one script and compare them.
I am wondering if there is any way to do such as:1: put all input filenames in a text file (file1)2: write a script3: Everytime, when I run this script, it will read in file1 directly no matter how many input files I have, give an output.I want this because I will have more and more input files and I don't wanna add multiple lines in the script just for reading the new inputfiles and compare them with the previous files. So, I guess this is something related to making my script a package or standardize it and make it easy to use in the future no matter how many input files I will have.
i trying to create file in /usr/local from below command"sudo df | grep /dev > dev_string.txt"First it asked for sudo password. I enterd sudo password. but I was not able to create the file dev_string.txt .Next time onwards it not asking sudo password also.the below execution flow
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..??
I want to know the Perl command to replace a string by pointing the line number. I know how to replace a string without pointing a line number but I am in need to replace only the two matching string in a file