Debian Programming :: How To Do Code Bash Script To Run Su And Enter Password
Sep 15, 2014
Whats the bash script for like, how synaptic package manager runs ..
When you run synaptic it ask for root password ..
How do I do this in bash script?
View 5 Replies
ADVERTISEMENT
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
Jul 7, 2011
I have a Windows domain with a proxy. I have an account that can use the proxy and the URL that points to the proxy.pac file. this might seem a stupid question but can anyone tell me how do I enter the username and password for my test Windows account so that Debian can authenticate it?
View 1 Replies
View Related
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
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
Nov 4, 2010
I need user to input a password through command line in Windows cmd prompt. Is there a way to encrypt the input (such as put it into ......) when user is typing ?
View 2 Replies
View Related
Jul 8, 2010
I have setup a debian server and it has been working fine but I moved it to a different location and not I am getting a problem. When I start the server up, it loads fine and loggin prompt. I can enter the username "root" without any issues but as soon as I press enter, I am not able to enter password. The cursor just blinks and i press enter, the server responds by saying invalid password.
I was connecting a USB keyboard and changed to Ps/2 but this didn't make any difference.
View 5 Replies
View Related
Feb 16, 2011
I want to write a c program with some shell scripts.Now For a simple C program. I am Setting a variable called val2 in bash, now I want to use bash variable val2 in C code. How do I do that?The above doesn't work (coz its spawning a different memory space and when shell script ends the variable dies with it as per my research but how do I keep them in same memory space)Also Is there any Good reference where they teach how to integrate C and Bash Together?
View 5 Replies
View Related
Jun 15, 2010
I have been scripting (or programming) in Bash shell for around 2+ years now. I have heard that ksh and zsh are better shells than bash. Are there any differences on the scripting side too, I mean is it easier to write a script in ksh or zsh rather than bash? Is there any benefit to code in ksh or zsh instead of bash.
View 1 Replies
View Related
Apr 16, 2011
I get no print to stdout on screen from the C code.Does bash somehow block or mask it?I get print from bash. I get this error in the non-test bash script like: let "rdval = $rdstr"syntax error: operand expected (error token is " ")The let command prints rdval= but I presume this is due to the printf test statements getting in the way.I am getting no compile errors. Why does the C code not print the values specified?
View 2 Replies
View Related
Feb 19, 2011
I want to write Bourne-shell script that will be to do finding and replacement in any web page code (.htm file) name of the tied folder in which have been saved pictures, .css, .js and other files. This folder create a web browser when we save web page completely and has so name as web page and has ending '_files'. I have many web pages where name of their folder are incorrect. Of course, my web browser shows these web pages without pictures. I can count amount of web pages in a folder (/path) needed for me.
1) find /path -type f -name "*.htm*" -print | grep -c .htm or find /path -type f -name *.htm | wc -l I can get list of web pages.
2) ls /path *.htm > out-list But I don't know how to assign the value from out-list (2) or result commands from pipeline (1) to a variable. Then I want to do next:
3)
var="1"
# where variable 'list' is an amount of web pages
while [ $var -le $list ]
[code]....
4)assign the 1st (then 2nd , etc. ) value from out-list (2) to variable 'webfile'
sed -n $var,+0p out-spisok
5)find the 1st string value '_files' in the 'webfile' grep -m1 _files $webfile
6)For example, 'abracadabra_files' is an incorrect folder in the 'webfile' I must to know start and end position 'abracadabra' without ending '_files', "cut" name of the incorrect folder and assign it to the variable 'finder' finder = 'abracadabra' BTW, name of a folder before '_files' is between '="' and '_files' in any web page code.
7)foldernew = $webfile (without '.htm')' foldernew' is equal with name of the tied folder without ending '_files' in the folder '/path'
8)find and replace in the 'webfile' and save result in the 'webfile-out'sed s/$finder/$foldernew/g $webfile > $webfile-out
View 5 Replies
View Related
Nov 30, 2010
I have read where C is first converted to Assembly before its final compilation to binary. Is there a way to do this with Bash commands? I would like the understanding that Assembly allows to Bash somehow.
View 14 Replies
View Related
Dec 20, 2009
I have a Bash script that runs other bash scripts. If the parent code fails, is there any way for me to also kill the child code?That kills any multiple instances of a script if I run it more than once. Is there any way I can just modify this into something that prevents the child code from running/continuing from running if the parent stops from an error?
View 3 Replies
View Related
Apr 12, 2010
I'm writing a bash shell script that among various other things will traverse through a directory with hundreds of files and rename those who match a pattern found in a config file. It's expected that only about one in ten files will actually match, and those who don't, will simply just be ignored for this purpose.
This should for instance cause the file "dBase program file December 1987.prg" to be renamed "Clipper source code December 1987.prg", and conversely "C++ source August 1996.cpp" to be renamed "C source code August 1996.cpp" etc.A sample file such as "Random Data File.dat" should not be renamed here since it's not mentioned in the config file..What is the quickest, most elegant way to do this in bash?I am thinking of using bash's built-in regex matching combined with the /bin/rename utility, but don't quite know how to get started to catch this..I guess there are plenty ways of doing this in perl and elsewhere as well, but since this has to integrate into a pre-existing bash script, that's what I'm looking for.Anyone out there with a spare moment to offer a hint in the right direction?
View 14 Replies
View Related
Jan 26, 2011
I'm having issue when trying to change a line in a file
[Code]....
View 1 Replies
View Related
Apr 28, 2010
I have a rather difficult problem. Every time I need root privileges and I am asked to authenticate (i.e. Update Manager, mounting a partition, etc), the password window comes up, shakes and immediately closes, leaving me with no chance to enter a password. What to do?edit: this is NOT the login window, just the little dialog that pops up when you need elevated privileges.
View 5 Replies
View Related
Apr 25, 2010
I'm trying to get a password in a bash script for mysql user creation. But sometimes a get a non-alphanumeric character(s) in the password, and mysql failes with that. I tryed with apg -EO0Il1`~!@#$%^&*()_+-=[];./{}|:"'<>? but failed. I tryed with sed 's/[^a-zA-Z2-9]//g' , but at that moment the minimum password lenght failed. I'm also fine when there is a better alternative then apg.
View 2 Replies
View Related
Aug 9, 2010
I'm trying to write a script that will prompt the user for a username/password, then create that user/password in the right groups on all my machines. I know this is kind of a long way around to avoid a NIS server, but I like making my life more difficult.
This is what I have so far:
Code:
the script has 2 problems: The "if" functions return an error and do not compare the strings successfully. whatever password is entered does get applied properly and the user is unable to login
View 7 Replies
View Related
Jul 13, 2010
I wrote some bash code to prevent redundantly including files, like php's "include_once". I've simplified it here so don't worry that it appears not to do anything:
Code: alias .='Include'
alias source='Include'
export __INC__functions=1
[code]....
View 1 Replies
View Related
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
Jan 29, 2009
I've tried Ubuntu, Arch, and most recently Fedora but the SUSE GNOME environment blows everything else away!
The only problem (so far) is that Network Manager requires you to enter your password every time you login to unlock the password keyring. I want to disable this.
I think some distros disable the prompt by using the login password to unlock the keyring, but I use auto-login (if that makes a difference).
View 4 Replies
View Related
Jun 30, 2011
I'm using Ubuntu 10.04LTS. I'm trying to configure my chat accounts. But after entering username and password, it is asking "Enter password to unlock your login keyring". I have entered my login password. But it is saying that "The password you use to log in to your computer no longer matches that of your login keyring."
View 4 Replies
View Related
Sep 11, 2014
I am developing a script to automate some database setup, but I have an issue I cannot figure out. I prompt for some input with whiptail and select a default if nothing is entered. However, if you do not enter anything, it normally returns 0, but this time it is returning an empty value.
Code: Select all # This one does work!
# Set the source path
TMPPATH=$(whiptail --backtitle "Linux Build Configuration"
--title "Source-Code Path"
--inputbox "Default: $SRCPATH" 0 60
3>&2 2>&1 1>&3)
[Code] ....
So what is wrong with the second code?
View 1 Replies
View Related
Jul 18, 2010
for reset Facebook password,facebook send a code to e-mail,this code can be sniffed by sniff software?
View 2 Replies
View Related
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
Dec 5, 2013
What is the complete process of integrating live chat software.
View 2 Replies
View Related
Apr 19, 2011
when i want to install update with kpackagekit, that fail because i don't get the screen to enter password
View 3 Replies
View Related
Feb 1, 2010
When I installed Ubuntu on my laptop, I had chosen "automatic login" . So i was not asked ofr username and password everytime I switched on. I later wanted to change the settings. So I went to systems-->administration-->login window-->security. There I disabled automatic login and I reboot the computer. Now the GUI does not allow me to enter Username and password. It says "Authorization denied" at the login screen.
View 7 Replies
View Related
Oct 30, 2010
After upgrading from 10.04 to 10.10, my laptop wouldn't boot into the GUI. I followed some steps that someone had posted at was able to get X back and working. Now, my laptop lost power without being shut down. I let it fix my disks, and I'm now back in the command line and can't get X working. Here's the weird thing...in the command line, I can enter my username ok, but it won't accept my password. I've figured out that it is the @ symbol in my password that messes things up. (I figured this out because when I typed something in the username, like "test" and then hit the @ key, it erases "test". I imagine it does the same thing and erases my password.)
View 7 Replies
View Related
Sep 1, 2011
I use numbers as passwords to enter WUBI installed on my notebook.
Recently i read that i have to use sudo etc. to upgrade to latest Thunderbird 6 linux version. When asked to enter password in sudo, nothing appears when i try to type in. I've used all the keys available. What gives?
View 2 Replies
View Related