Ubuntu :: Running Bash Perl Scripts On Desktop Click?
Nov 8, 2010
I wanted to run bash and perl scripts which requires SU privileges by clicking on dektop Terminal window opens and closes fast without knowing what happened.
scripts work on terminal window by telling
sudo perl file.pl
sudo bash file.sh
Perl has this header
#!/usr/bin/env perl
[Code]....
How can I run them with desktop shortcuts with SU privilege so, the terminal will not close after execution?
should not the scripts work without telling perl or bash,
View 1 Replies
ADVERTISEMENT
Nov 8, 2010
I wanted to run bash and perl scripts which requires SU privileges by clicking on desktop
Terminal window opens and closes fast without knowing what happened.
scripts work on terminal window by telling
sudo perl file.pl
sudo bash file.sh
Perl has this header
#!/usr/bin/env perl
or
#!usr/bin/perl -w
Bash has header
#!/bin/bash
How can I run them with desktop shortcuts with SU privilege so, the terminal will not close after execution? Should not the scripts work without telling perl or bash, since they have the header?
View 4 Replies
View Related
Mar 17, 2010
I am writing a script based image manipulator but i need to know if X is running so i can tell if i use CACAVIEW to imagemagick DISPLAY command.
View 14 Replies
View Related
Apr 30, 2011
After I adjust my slackware and rebooted I saw a strange "rectangle" on my desktop. Please, look at the screenshots below and tell me how I should solve this problem.
I can't move it. Right-click menu on a rectangle coincides with a right-click on desktop. It does not prevent, but very annoying.
View 14 Replies
View Related
Sep 18, 2011
I'm new to KDE and am running KDE 4.7.1 on top of Arch Linux. It's fantastic however I have one problem - virtual desktops. Yeah I know there are those "activities" things which people say replace virtual desktops and I will look into them, but for the moment I want to stick with what I know.
And it's almost set up too. In fact, it is, apart from one issue: Say I'm on desktop 3 and I click on the desktop (as in - the bit with my wallpaper, etc, not the little square in my panel) - it immediately switches to desktop 1. Got no idea why I'd want it to do that and it's bugging me.
View 1 Replies
View Related
Jul 17, 2010
below are the details of my system. I have bash as my current shell, some really common commands aren't working.
Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])
Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$
[Code]....
View 13 Replies
View Related
May 7, 2011
I was just playing around with the Unity plugin (adjusting opacity) and now the files on my desktop aren't there (yes i know that those files are in the desktop folder) but they don't show on the desktop. also, when I right click on the desktop, nothing happens. it all changed when I played with the Unity plugin by adjusting opacity... I really liked having files on my desktop and being able to change my background by right clicking...
View 1 Replies
View Related
Jan 16, 2011
I can not make this work: I can send email from bash with this script: #!/bin/bash echo "Test message" | /usr/bin/mail -s "test2" "myEmail@yahoo.com"
When I am trying to run this in Perl using system function like this:
#!/usr/bin/perl
system("'Test message' | /usr/bin/mail -s 'test2' 'myEmail@yahoo.com');
I get message that program exited with code 0 , which is nice, but mail does not get to destination.
View 6 Replies
View Related
Jul 29, 2011
I've been asked to do certain jobs doing scripts in bash and perl. So this time they asked me to check which users hasn't been able to loggin. DONE with Code: lasb Now they asked me to show how many times all the users have input certain Bash Commands like
Code: Ls Cd pwd I was wondering if there was a command of something that could show me how many times those commands has been used, I already know I can see all input with Code: history Sorry I'm really new to this, been working with this for a couple of weeks, and its really interesting.
View 3 Replies
View Related
Mar 23, 2011
I'm playing with perl and found that I could just go:
"perl /home/me/bash_script.sh"
and it would execute, even though it's not a perl script. Is that just a feature or is there something I'm missing? Why does perl do this?
View 2 Replies
View Related
May 24, 2010
I wrote this script for bash & perl. If you run it in bash it should work. It changes title - (uuid) kernel - initrd ... to title - uuid UUID=the_uuid... kernel - initrd .... When I wrote it I replaced end of lines by . It's the second $block definition. But now I need to repair it, because I will work with the 1st $block definition. That is not to exclude end of lines, but leave it be untouched. Now when you escape the second $block definition, the code does not work. What I have to do to repair it working with multiline input data?
Code:
block="title Sata Mandriva
kernel (UUID=eab515e9-bc3e-4024-9f01-55fddaa0fb1c)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=eab515e9-bc3e-4024-9f01-55fddaa0fb1c resume=UUID=e12487ff-6d6f-44c4-9e03-33f545b3b798 splash=silent vga=788
initrd (UUID=eab515e9-bc3e-4024-9f01-55fddaa0fb1c)/boot/initrd.img"; .....
View 10 Replies
View Related
Jul 26, 2010
I presume there is something in the JWM window manager - or Puppy Linux Lupu 5.01 itself that is conflicting with the normal loading of GMPLAYER....
I would like to know how to troubleshoot, and fix this problem if possible (even a workaround would be great).
View 1 Replies
View Related
Apr 8, 2010
I've been trying to figure out a way to more easily color text in Perl like I do on Bash on a Linux box. In bash, what I'll do is set color variables up to equal the escape sequence, then echo out with escape seqeunces to print it exactly how I want it. Typically I'll want a character or a word in a different color, not the whole line. For example
echo -n -e "My face is turning ${RED}red${UNCOLOR} like a lobster." In Perl with the term::ANSIColor module, it seems to just do a line. Am I being dense? Is there a way that I can do it like I do it in BASH that's fairly easy to read after the fact?
View 11 Replies
View Related
Feb 13, 2011
I would like to find something portable that work on all machines. I have hmtl2text installed, and perl and sh.
Anyone would know if someone already made such thing to read new through the console ?
View 1 Replies
View Related
Mar 11, 2010
I've recently inherited a bunch of files at a new job and am trying to figure out some of the problems that have constantly popped up. The one i'm getting a huge headache with results from a bash script that is supposed to change a date format from a client populated txt field to one we want defined a certain way. Everything in the script works fine, except that one function. Below is the line i'm trying to manipulate, with date examples.
sed -e 's/.0000 EA/ EA/' -e 's/ 01012010 / 01-JAN-2010 /' -e 's/ 12312011 / 31-DEC-2011 /'
The one caveat is that the first date is non-static and changes daily. It is, however, always the current date. If it helps, the second date will always be a year away from the first date.My idea was to pull the current date via perl's DATE function, but...how to do it, and calculate a year away without throwing the rest of the bash script off? Any help would be appreciated. I'm sure it's a simple solution but i know absolutely nothing about these scripts and how they were written.
View 10 Replies
View Related
Apr 1, 2010
pretty simple. how would you background a process from a script and get its process id at the same time?
View 6 Replies
View Related
Jul 11, 2010
This pretend to be a script for rename a lot of files automatically. So I put the list of files in an array named @lista. But, as you can see, at the end of the command I use a sed filter to print out a backslash for those files that have spaces in their names, so the path for those files could be rightly interpreted.
But there's no way I could print a backslash. It works well when I use the Perl's sed substitution s///, but I need every path in the array to be fixed.
I'd like to add that the bash command works perfectly well alone. I mean outside the Perl script.
This is de command line with the sed filter:
Code:
And this is what it brings:
Code:
View 12 Replies
View Related
Oct 31, 2010
I'm using Ubuntu 10.10, and I just installed findimagedupes (plus dependencies) from the repositories. I get the same error message no matter how I invoke it:
Code:
$ findimagedupes -R -- images/
Can't locate findimagedupes/C.pm in @INC (@INC contains: /usr/lib/findimagedupes/lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/bin/findimagedupes line 41.
[Code]...
View 6 Replies
View Related
May 4, 2010
Seeking a decent Perl or Bash script or hack used to copy data from a CD/DVD to local or even remote hard drive/storage.
View 7 Replies
View Related
May 26, 2011
I have created a simple web form which pokes a PHP script:
<form name="update" action="http://www.mysite.com/script.php" method="POST">
<input name="submit" type="submit" value="submit">
</form>
I can easily surf along to the URL [URL] and click the submit button which pokes script.php and everyone's happy. Automating this in iMacros or Selenium - no problem.
I want to automate this in a bash cron on the same server - preferably as a one-liner.
I *thought* something like this might work:
Code:
wget --spider --post-data="submit=submit" http://www.mysite.com/wget.html
or
Code:
curl -d "submit=submit" http://www.mysite.com/wget.html
and many variations thereof but no luck.
Is there ANY way I can click the submit button from a Bash command line? Curl, wget, lynx - one of these simply MUST be capable of this.
I do not want to run script.php from the command line - there are loads of relative links etc.
View 14 Replies
View Related
Nov 30, 2010
I am having a shell script which runs perl jobs.The script is starting the perl jobs when it is executed manually from the command line , but when the same script runs from crontab it is not starting the perl jobs.I have these things in the begining of the script
. /etc/profile
export MDX_HOME=/home/entsms
source $MDX_HOME/.bash_profile
[code]....
View 1 Replies
View Related
Jun 27, 2009
quick guidance on running a bash script using Perl. The script is calledarchive_web.sh.The regular script I have and use now (archive.sh) creates an archive directory (uses the current date as the dir name) and moves all existing files there.The script is cronned to run every day before midnight. I'd like to be able to run this "archiving script"manually, from the web, at my own discretion, rather than necessarily wait till midnight (but want it to run then, too, in case any new files present themselves in the directory).These shell scripts sit in an .htaccessed directory. Talk about making up verbs all over the place.
View 1 Replies
View Related
Apr 29, 2010
I try to configure mouse click interval since a single click is recognized as double click by doing it from KDE mouse configuration in system settings; but my attempt doesn't work even (I set the click interval to 2 sec, but doesn't change anything). What is the best way to do this in slackware?
View 4 Replies
View Related
Apr 4, 2011
I'm writing a bash script that executes a few perl scripts. One of the perl scripts that I need to execute requires two arguments with it. The arguments are stored in a txt file, each line contains a hostname and its corresponding IP address separated by a ":" (colon), the txt file looks like this below:
[Code]...
I'm not sure if it's the best way to accomplish this but here it goes. In the bash file, let's call it getHosts.sh, I create an array and assign each line of the file to an element in that array. I then think I need to create a new array where I take the hostname (which is before the ":") separate it from its IP address and place the IP address on a new line just below the hostname (this way I can reference to it like $hostNames[$x] would be the hostname, and $hostNames[$x+1] would be its IP address). So the new array would now look like this below:
[Code]...
View 4 Replies
View Related
Feb 14, 2011
I wanted to find and replace a string from a perl file. I have written a script in bash which runs the following command.
perl -pi -e "s/$findstring/$replacestring/" testfile
where as $findstring = print F_WC_TMP"$line
";
and $replaceString = $line = join ' ', split ' ', $line; print F_WC_TMP"$line
";
But when I am running the above command, i think it is replacing the $findstring with the above mentioned string and hence it contains a $line, it is looking for the variable $line and not finding the exact string. I am confused about how to search for a string that contains $ in it and replace it with another $string.
View 5 Replies
View Related
Feb 10, 2011
Everyone knows that it is like impossible to use mplayer to watch an *.html file. OK.
For instance here is a cool example of lot of streaming for firefox
http://watchtvlivestreaming.com/tvlive/b5499
Code...
Anyone is there a talented bright coder, coming from hell -because it is really difficult, to make such console program ?
View 1 Replies
View Related
Jun 30, 2011
I am trying to fix a perl script, and I really suck at perl. But I think this problem will be easy for people who know it.
The problem is, I have an old setup script someone wrote many years ago. It fails if the standard shell is dash and not bash. The only way I've gotten it to work is to point /bin/sh to bash. I looked thru the script and it uses "system" many places, and I think that's the problem.
I searched for it and found this link:url
My plan is to include this function:
Code:
sub system_bash {
my @args = ( "bash", "-c", shift );
system(@args);
}
Then I could simply change all calls to system into system_bash and it should work?
The parameter to the system calls is usually some variable. What if the parameter is a list already? Do I need to test for it somehow, and if it's a list, prepend "bash" and "-c" to the list? How do I do that?
In the script there are lots of places like this:
my $error = system($cmd);
if ($error) {
die/warn "some error message";
}
Shouldn't there be a return in the system_bash function?
View 8 Replies
View Related
Jul 9, 2010
how do i write a bash script to mimic my right button click any ideas or command names to steer in the right direction would be great.
View 3 Replies
View Related
Jun 23, 2010
I'm getting something(s) wrong, trying to run commands (both simple and piped) in shells from Perl programs. The ultimate objective is to set up "copy X selection to clipboard" from urxvt but apparently simple debugging statements are not working.Here's the Perl, taken from here and modified to use xclip instead of xsel and with debugging added, shown in green
Code:
#! /usr/bin/perl
sub on_sel_grab {
[code]....
View 5 Replies
View Related
Apr 6, 2010
I'm not sure if this is best done in Perl or Bash. I'm thinking surely someone else has created something close to what I'm looking for. The results of the script would be that someone would kick off "linux_hosts.sh" r whatever you want to call it, then a top "folder" of options (with hosts contained within each of these top menu choices), then, based on which number corresponds to that top level, they're presented with a set of linux hosts that are relevant to that top level name. Example:
$ linux_hosts.sh
1. VMware hosts 4. Private Domain
2. ESX servers 5. Red Hat boxes
[code]...
View 4 Replies
View Related