Programming :: How Can User Runs Bash Script At Boot Of PC?

Dec 28, 2008

I wanna that the pc starts (on/off), the pc arrives to gdm. It waits for an user to log.But but at the boot of this machine, I would like that an user has a script started in the processes (NO X cuz bash script).How can an user runs a script at boot of the PC ? (once only and no one loged)

View 4 Replies


Programming :: Make Script That Runs Program As Another User With Pass?

Jun 7, 2010

I'm trying to do a shell script which are suppose to run a program as a specific user at system boot up. The problem is that I don't know for sure how to make the script add the users password to the prompt when it's necessary.

Basically the program would be run like this:

sudo -u extrema program_name -r /srv/program_name -d

and in this example the password is, "hidden".

How would I make this script run this program as user extrema with the password "hidden" at boot-up? I know how to put the script in the rc.X directory and so on, its more the syntax of the code.

View 4 Replies View Related

Programming :: User Input Bash Script

Apr 28, 2010

I've written a bash script that allows a user to input a directory location to find out the size of the directory. However, if the user inputs a directory and finds its size then inputs another directory then wants to quit, the script asks the user numerous times if he wants to quit!! The script won't exit until the number of times the user looks at a directory is reached! What gives?

Here's the script:


View 4 Replies View Related

Programming :: Switch User In A Bash Script?

Jul 28, 2011

I need to switch from one user to another in a script in a solaris machine. No one of those users is root. I see I can use su commandt I think I can't pass the password as a parameter . I'm using bash. Is there anyway that I can switch user in a bash script

View 7 Replies View Related

Programming :: Working With User Input In Bash

Jun 2, 2009

I've been using python/bash to help myself automate things for a long time, however I am curious. One reason I use python more is because I don't quite know how to work with user input in Bash, such as getting it to ask for input and wait, and then placing that user input into a command.

Here's an example of a script I use from time to time for converting OGG video files into AVI.

How could I write this same script in Bash? Keep in mind I am mostly self taught, so I am by no means an expert programmer.


View 3 Replies View Related

Programming :: Bash Script Predefined User Input

Aug 9, 2009

I have a script im having some problems with, what I need is to have the system generate a random password for me and use that password when creating new users to it.

System is Debian Lenny and script is in bash.

The program is znc. I have made it so that it will generate the random password on the shell but the problem is to use it in the bnc software.

To make a password there the command is znc --makepass and look like this:

My question is now if it would be possible to put in the script so it would "answer" when it need those passwords ? the random password that is generated is in a variable called $setpass and is NOT crypted.

Or is there any other software that would be able to generate that md5 string for me ?

View 7 Replies View Related

Programming :: Get A Password In A Bash Script For Mysql User Creation?

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

Programming :: BASH - Create User And Password On Multiple Machines

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:


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

Programming :: Catch User Input While The Bash Script Is Running?

Oct 30, 2010

How do you catch user input while the script is running? Or, how would you make two scripts run at the same time, but use input from one script to the other? The program I'm trying to make, echos text on the screen continuously, but while thats happening, I want the user to be able to input something, so the program can detect the input and display something else. So I thought maybe I could make two scripts run to do each task.

View 5 Replies View Related

Programming :: Bash - Calling A Specific Variable Based On User Input?

May 3, 2011

I'm trying to call a specific variable based on a user selection. For example:

Code: Select a file:

[1] foo.tar
[2] bar.tar

Enter a selection: I have already coded each possible selection to have its own variable. If the user selects 2 I need to select $SELECTED_TAR2, or if they select 1 I need to select $SELECTED_TAR1 and then do something like this behind the scenes:

Code: cp /home/user/$SELECTED_TAR2 /home/user/backup/$SELECTED_TAR2

I was thinking something like this:

Code: echo "Enter a selection: "
cp /home/user/$SELECTED_TAR$SELECTED_NUMBER /home/user/backup


View 2 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:

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 Scripting Handling User Input Sections Automatically?

Jun 17, 2010

I have a system setup script for my Slackware installations that pulls all packages and source files from another machine and sets everything up to be identical between machines. The script works as expected but make it entirely unattended. How do I make the bash script deal with automatically selecting "Yes" for, for example "Install x(Yes/No): " when prompted by a make file?

View 3 Replies View Related

Programming :: Check If The User Is In Correct Directory Before Executing Bash Script

Dec 10, 2010

I have been searching for 90 minutes for something that I "think" should be fairly easy. I'm pretty new to Bash Scripting so I could be completely wrong. Then again it may be a weird request to even need something like this. But here it is.I have a script written to convert data from one of our software version to another. The only thing I need to add to it is a "check to make sure the user running the script is in the /tmp directory".

View 7 Replies View Related

Programming :: Bash Scripting - Display Real Name From Username Logged In + User Processes?

Jan 14, 2011

i am using putty to connect to the linux server and i am using nano as my text editor to write a bash script.

this is my script:

echo "Please enter your Username"
read userName
userName= grep $USER /etc/passwd | cut -d: -f5
echo "Welcome " $userName | cat >> output.txt

the problem i have is that when i enter my username, the output (my real name) does not display in the output.txt. instead it displays in putty. so when i run my script in putty it shows the message to enter username and after i enter my username my real name appears below it. i want it to show in the output.txt

View 1 Replies View Related

Programming :: Bash Scripting - Taking User Input And Adding It To A Particular Area Of A File?

Jan 12, 2010

in bash scripting...say I want to take the input from a user via a question...I would do this:



echo "How large do you want this partition to be in GB (enter only the number)?" read PART_SIZE echo "You want your partition to be $PART_SIZE GB" But I don't want to echo it back to the screen, I want to add it to the content of /etc/fstab. I have been mucking around with sed to find the tmpfs partition in /etc/fstab and add the partition size attribute (this is to use the onboard RAM as a volatile partition)...but am not having any luck...

The portion of /etc/fstab that uses /dev/shm for the tmpfs partition is:

tmpfs /dev/shm tmpfs defaults 0 0

So, if a user says "24" GB to the answer (from above), how do I get it to automatically add that value to the tmpfs partition line in /etc/fstab? So it would look like:

tmpfs /dev/shm tmpfs size=24g,defaults 0 0

I understand that I would also have to come up with a way to put "size=XXg", which I could do with a copied over generic file before this action...then the script would have to find "XX" and replace it with the user's figure...

View 7 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:


zip -r example * -e

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

View 14 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 :: Get Bash Script Using Zentity To Exit If The User Presses The Cancel Or Close Buttons?

Feb 3, 2011

I am trying to get bash script using zentity to exit if the user presses the cancel or close buttons.The exit codes are working fine; they read 1 or 0 depending on the status but it always assumes 0. This is the portion of the script: PHP Code:

function settings(){
result=$(zenity --height=30 --width=300 --list --checklist --title='Selection'--column=Boxes --column=Selections --column="Options" 


View 2 Replies View Related

Ubuntu :: Bash Script That Runs A Program N Times?

Oct 20, 2010

A bash script that runs a program N times, takes the numbers program produces (each time different) and calculates the average of those numbers.

View 2 Replies View Related

General :: Use For A Web Interface That Runs Bash Scripts In Bckgrnd?

Jun 7, 2010

I have a set of bash scripts which I need to execute through a web-interface. So that they can be executed remotely, once the web-interface is hosted on a server. Since this is the first time I am trying something like this, I am not sure what language or technology to use for such work. From my knowledge PHP could be a good fit. But not really sure.

View 1 Replies View Related

Ubuntu :: Bash Scrpting - Error - Can't Open The Script File And Only Runs Once

Jan 26, 2010

I am trying to run a PHP script over and over again. I would love to be able to just write a small bash script that will just do this for me, however I am having trouble writing a for loop that works. Here is what I have now:

When I run this (./bash_import) I get the following errors:

I have also tried just doing the "php wps_product_import.php" on 20 different lines and I get an error saying it can't open the script file and only runs once.

View 9 Replies View Related

Server :: Which User Runs Apache/PHP?

Aug 27, 2010

I migrated joomla to my new server and noticed that the script doesn't have the permission to edit it's own configuration file and write to the cache folder. All my files are owned by root, which I guess isn't a good idea.

As what user do the PHP scripts run? Or is this system specific? I don't want to chmod all files to 777 so I'd just like to change file and folder ownerships to the user that is executing that script.

View 1 Replies View Related

Slackware :: 13.1 Runs Fine As Root, Crashes When Run As User?

Jun 26, 2010

I have had slack 12 on this computer for quite a while with never a problem. Slack 13.1 was installed a few weeks ago without a problem, it seems to run forever as long as it is root. When I go to user it will crash 2 or 3 times a day. When it crashes it is a total lockup that only the off/on switch will reset it. There is no certain time or thing that causes it, it will just lockup while surfing using the command line switching or opening a new le. Any suggestions will be appreciated! I have googled and searched with no info found.I do have 13.1 on another computer that works fine, it has an nvidea video card in it and it is 64 bit.

View 12 Replies View Related

Red Hat / Fedora :: Apache Runs Under User Wwwrun And Group Www By Default

Aug 3, 2010

I want to ask a question maybe a stupid one Here what i understand saying linux user : i can create various users for example for me , for my brother and so on to log in to system. But what does it mean that apache runs under user wwwrun and group www by default . What kind of user is that ? It's explicitly not a user kind that one I know about .

View 6 Replies View Related

OpenSUSE :: Application Runs Very Slowly When Using Dolphin In Super User Mode

Apr 20, 2011

In graphic interface, when I use dolphin to view the files in super user mode, this application runs very slowly, and react dull at each request!

View 7 Replies View Related

Programming :: After USB Boot - Detect Which Device The Ramfs Was Loaded From - Bash Or Python

Sep 22, 2010

How one could determine (for use in a Bash or Python script) which device (eg /dev/sda1, /dev/hda1... etc) a ramfs was loaded from when booting from a USB drive.

I have a RIPLinux/Tinycore live USB disk that automatically needs to run a script that is stored on the same USB drive but not part of the RIPLinux/Tinycore image. (Please note that I do not want to put this script into the RIPLinux image.) I therefore would like to remix the RIPLinux/Tinycore ISO to automatically run this script once it has started up. After RIP linux has booted I would like to automatically mount the USB drive that RIPLinux/Tinycore was booted from. I need help detecting which device this is.

View 3 Replies View Related

Ubuntu :: Launcher For Quake That Essentially Runs A Shell Scripts That Runs Quakespasm With Certain Options?

Oct 13, 2010

I have a launcher for Quake that essentially runs a shell scripts that runs quakespasm with certain options. Is there a way to add it to AWN?

View 6 Replies View Related

Programming :: PHP Debugger That Runs On A Webserver?

Jan 24, 2010

I'm a newbie on Linux and currently in the process of installing it. I'm planning to install the latest version of Apache, MySql, and PHP on the machine with a debugger on it. I haven't decided which debugger is suitable for this environment since I don't have any experience on it.

View 5 Replies View Related

Programming :: Multiple Runs With The Same Login, C++?

Aug 3, 2010

I am trying to implement a corba program (client) to retrieve customerinformation from the server. Since the server allow to login once andperform your operations until the lifetime experies, i want the client to use already login connection to perform the retrieve function withoutlogin in to the server for every request.Suppose retrieve has three functions, logon(), perform() and logoff()Pseudo code;Quote:

1. User runs a client application
./retrieve <URI> <customerID>
2. if the client program has already login, donot login, go to 4


View 3 Replies View Related

Programming :: Create The Thread Which Runs Then Drops Out?

Mar 11, 2010

I hope someone can help me with this. I need to call the same thread multiple times, but only run one thread at a time. So what I do is create the thread which runs then drops out. Run the main loop and after some time pthread_create the same thread again. So in pseudo code


I always presumed if I run a thread and it reaches with a pthread_exit, then the thread was destroyed? However I've found that after I've created the thread several 100 times the programme crashes? So can anyone advise how I call the same thread over and over?

View 10 Replies View Related

Copyrights 2005-15, All rights reserved