Debian :: Bash Script As A Program?
May 21, 2011Is there a way to have a bash script run as a program so you can start it like how you would run apt-get?
View 2 RepliesIs there a way to have a bash script run as a program so you can start it like how you would run apt-get?
View 2 RepliesI will have to code this. However I am lacking of time since I have too much to do. make a short code bash/dash to prompt the country with Zenity, then, get the PLS or m3u url and prompt with another zenity which radio to play. http://www.listenlive.eu/index.html
My code to get url's radio country.htm is:
Code:
So I open firefox from my bash shell with:
Code:
firefox google.ca
it opens firefox, I can browse, etc.
Now if I alt-tab back into my shell, i can't enter any commands in the shell.
I know that i can do this if I close firefox, but I want to keep working in my shell with firefox still open.
Is this possible?
I'm trying to write a bash script that helps me building C program then run the C program but I don't know how to make it run.I did like this
Code:
#!/bin/sh
# assuming I've built C program '$output' successfully
[code]....
how to interactively operate with program using bash? such as program would ask user to select choice between "a/b/c" and then input enter to confirm? i know i could use
program << EOF
a
EOF
to choise "a", but how to input "enter", so that i could call this program in my script.
I have for example the following IP addresses:
24.172.220.218
41.239.36.19
63.215.202.234
66.176.124.22
[code]....
How can I sort those IP addresses? I want to sort them using the first 3 numbers I also want to count the number of times that address is repeated This is a batch program.
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 RelatedI wrote this script which works but it should run automatically about once per week. I hunted and experimented with KDE Task Scheduler (no dice and no help anywhere) and cron (confusing instructions and cannot edit crontab -e with vim, and cannot enter cron folders/files). I would settle for a desktop shortcut to run the script but found no for that.
Script:
Code:
#!/bin/bash
xterm -hold -e fstrim -v /
Machine:
OS: openSUSE 11.4 x86_64
[code].....
Trying to do a simple bash script, and having some issues. I am relatively new to bash, and did my best to search, but idk what exactly to search for.
Doesn't work code...
I'm trying to write a bash script program in the Linux command terminal that will write to a fellow user and then continue reading down the program. this is what i have (kind of explains the idea too):
#!/bin/sh
clear
echo "this is before the write command"
write jcummins
this message should go to jerry
echo "the message didn't send and this string will not appear"
echo "it appears it has stopped at the write command"
I am trying to write a bash script that installs a program fully automated for me. I am stuck at the one part where i need to change a line in one config file. I have tried various syntax for sed and none have worked. Maybe someone can suggest how to go about this. Since the line appears in the middle of the file, I can't use echo or cat. Also the file will be diffrent lengths depending on the install.
The line I need changed is:
I need that changed to:
the last syntax i tried is:
Yes this is for PNP4Nagios on centos 5.6 64bit. If i can get this figured out. I will be willing to post the whole thing for others to use. it will be used to install PNP after a working nagios install is done.
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 ?
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).
I have a virtual server with debian and since last Friday a problem. The server is running normally. All sites hosted show no problems. But If I logon via ssh is the CPU usage of all cores goes to 100%. A simple cd (change dir) then takes about 90 seconds. using top or htop bash is the top scorer. Unfortunately I have absolutely no approach what I have to change here or where the misconduct comes from.
View 2 Replies View RelatedI'm in the process of switching from Ubuntu 10.04 to Debian 6.0. The install went pretty well after some tinkering, but I want to replicate my bash environment from Ubuntu to the new Debian system.
I've copied over my /etc/bash.bashrc and my /etc/profile. I renamed my ~/.bashrc, logged out and back in, and expected to have my original shell environment because I would be defaulting to the system-wide settings in /etc.
Instead, the stock Debian environment remains: No completion, only the $ prompt, no up-arrow history, etc. I don't get what it's reading from and why /etc/bash.bashrc isn't being accessed. (Bash completion is installed.)
when i created new user with # useradd -m newuser and logged in as newuser, i cannot have the autocompletion that the first user have.Why? How do i set newuser to use bash and the same for all other user?
View 5 Replies View RelatedI would like the ability to manipulate a jpg (bmp, gif and raw would be nice as well) while in BASH. To be more specific, I would like to either add a water mark or a little section as a footer on the bottom of an image.
I will be using this as part of a shell script to alter files in a directory on my webserver.
How can we do a file replacing string on debian/rules file using sed and bash variable ? I don't seem to be able to do so. I have tried below under the install section with arch dependent amd64, as far as I know all the bash commands are allowed to be executed in debian/rules file.
I have tried this :
Code: Select all
debian/rules file
ipaddr=`<long command to find ipaddr>`
myVar=`hostname`
sed -i -e 's/somestring/'$myVar'/g' $(configs)*
sed -i -e "s/somestring/$myVar/g" $(configs)*
[Code]...
Nothing works. Sed works but the hostname replacement doesn't work.
I'm trying to get a bash script to do different things based on the time of day, but at least once a day the test fails:
Code: Select allNOW=$(date +%k%M)
if [[ "$NOW" -ge 1000 ]] && [[ "$NOW" -le 2200 ]];then
alarm lon
else
alarm loff
fi
This is the error, and line 59 is the second quoted above:
Code: Select all/home/electrolux/bin/ts.sh: line 59: [[: 059: value too great for base (error token is "059")
The script is run every minute, and this error only occurs at 12:59AM, or 00:59.
I presume the problem is either $NOW is being set to 059, or the testing is seeing 0059 as 059. I think the latter, because for the rest of midnight 'til 00:58 the script works. And with some Googling it seems that the leading 0 is making test treat the number as octal... is there a way to tell it it is decimal?
Perhaps this is just some poor time-testing code? Looking at it I don't think it will cope with set time period that crosses midnight..... there's probably just a command to do what I want, isn't there? I know I could have two different scripts cron'd for the different time periods, but it would be much more preferable to be just the one.
i'm trying all the time to use this (find,sed gnu,..etc) scrip to find and remove this string in all files *.php in wwwbackup/ directory. the script work without any error, but doesn't remove any thing!?
find /home/usr/wwwbackups/ -type f -name *.php -print0| xargs -0 sed 's#echo "<iframe src="http://internetcountercheck.com/?click=2255046" width=1 height=1 style="visibility:hidden;position:absolute"></iframe>";##g' -i
how can i become this script working?
how to do in Debian
1. am required to create a bash-shell script called terminator that terminates all processes of a name given to the shell script as an argument. Make sure the terminator shell script will not take any crucial file system services as arguments.
2. Show how you would configure an Ethernet card by reapplying your existing IP and network mask
3. Install a workable nfs file sharing system between your system and a remote system, using optimum values for resize and wsize.To demonstrate send a 512Mb block of random data between client and server using the dd command.Write down the relevant steps and procedures
You are probably using systemd (check it with ps --pid 1) and therefore /etc/init.d isn't considered for autostart. Here can you find some information about systemd and autostart [1]. As far as I know systemd isn't intended to start applications with systemd. I recommend you to use the autostart feature of your window manager or desktop environment or at least the .xinitrc.
[URL] ....
I had tried to control lynx by bash script. I can use bash script to let lynx open an url. After that, I can't do anymore. I don't understand how to move the cursor or fill some textbox in the webpage opened by linx in bash script.
View 3 Replies View RelatedI did install a brand new debian etch on my server, update and upgrade has been done.I did installed a postfix and couple of tools ( like courier-* ).But when i want to try to sent a mail with mail command, it says command not found.I did use the method on the bottom of this thread succesfully, but any idea for this tool to be back on my server ?Did i uninstall it when installing a package ?
View 1 Replies View RelatedI'm trying Debian again just for fun after using Slackware for years. When I "su -" on Konsole in Debian I get this for my prompt:
Code:
darksaurian@darkswamp:~$ su -
Password:
darkswamp:~#
darkswamp is my hostname that I made up when I installed. On Slackware I'm used to it saying:
root@darkswamp
or something like that.
I'm starting Konsole the same way on both:
konsole -e $SHELL -l
I kind of wish it still said "root" just because I'm used to it.
Upon booting, how can I know which program starts first? Also, how can I force something to start after something else? For instance, how do I make sure that everything I deem as "not urgent" to load after the GUI and also how do I make sure things like firestarter start before fail2ban, etc?
View 2 Replies View RelatedI have recently installed Debian 6.0. Tried to install a program ,but I could not do it. The prog is called IOmeter (sorry, can't link it). I have also tried the " sudo apt-get install command i the terminal. It's easy to install the prog in Windows.
View 2 Replies View RelatedI just have a quick question. I was following a Snort setup guide and it told me to do apt-get install snort-mysql. I just wanted to understand the functionality of such a command where you specify a program and then do a -mysql (snort-mysql). Does this configure an SQL database for that specific application or what?
View 2 Replies View Related[code]...
It says it requires version 2.17, but the one in the repository is libblkid1 (2.16.2-0) as seen on [URL]... I guess almost no one else is getting this as it isnt fixed! And it is such an important program (mkfs.ext*) Should i install the one from sid's repository? If this is such a huge bug as it seemes to be, why hasnt it been fixd for more than a day (after an "aptitude upgrade", then i noticed this).
I am trying to create scripts to move files over from one directory to an ftp server and there is this one file with spaces that bash is see each word as being a file, here is the variable i am trying to use:
Code: Select allLOCL = '/mnt/cifs/"File name with spaces"/'
cd $LOCL
ls -l