I'm trying to write a bash script to install PostgreSQL server on a Debian 6 VPS.
I'm trying to add a function to my .zshrc that makes adding new USE flags to my /etc/portage/package.use file easier. Normally, I'd have to do
su -c 'echo "net-misc/aria2 bash-completion bittorrent" >> /etc/portage/package.use'
So I tried making a function like
new_use() {
su -c 'echo "$1" >> /etc/portage/package.use'
}
but then I realized it wouldn't work.
This question is a sequel of sorts to my earlier question. The users on this site kindly helped me determine how to write a bash for loop that iterates over string values. For example, suppose that a loop control variable fname iterates over the strings "a.txt" "b.txt" "c.txt". I would like to echo "yes!" when fname has the value "a.txt" or "c.txt", and echo "no!" otherwise.
Hey guys I made a very useful application using Bash script I am so excited about it, I wonder can I package this bash script as an installable .Deb package and give it to people to install it ? [I would want my bash script to be copied to the bin folder so it be run able]
another question is, if I be able to do that, what should I do to list my program in software center?
#!/bin/bash
function abc() # wait for some event to happen, can be terminated by other process
{
sleep 3333
}
echo "PID: $$"
abc &
echo "PID: $$"
I need to retrieve the pid of this function, but the echo prints the same string.
If I'm not going to put abc() out of this script, is it possible to get it's pid and terminate that function?
Ok so I got a little bored and desided to make a fun little bash script that you can use to scare Linux neewbies :)
Here is the code:
Quote:
#!/bin/bash
clear
echo "Formating disk(s): " /dev/sd*
sleep 2
echo "Initialising..."
sleep 2
echo "Are you sure you want to format these disks?"
# Declare variable choice and assign value
Im new to bash and have written this script to collect data then save it to an automated file it runs fine till here but as i try to rerun the script to add another details it gives me errors.
please cam you help
!/bin/bash
This program helps the user to collect contact details.
clear
options="Add_User End_session"
echo "1. Add another user"
echo "2.
It is very interesting that if you intend to display like "0_1" with bash using the code
x=0
y=1
echo "$x_$y"
then it will only display
1
I tried echo "$x\_$y" and it doesn't work.
So my question is how to echo the form $x_$y ? I'm going to use it on a file name string.
I'm new to bash and have written this script to collect data then save it to an automated file. It runs fine til here but as I try to rerun the script to add another details it gives me errors.
#!/bin/bash
#This program helps the user to collect contact details.
clear
options="Add_User End_session"
echo "1. Add another user"
echo "2.