Hi everybody,
I'm rather new to bash, and somehow just haven't found out what I'm doing wrong here:
(this is a small bash script calling my generator)
if [ -n $folder ]; then
$zorbalocation -q $generator -f -e files=\"$lFiles\" -e folder=\"lFolder\"
else
$zorbalocation -q $generator -f -e files=\"$lFiles\" -e fo...
I'm trying to make this command:
sed bla bla filename | awk '{printf "%s %s_entry_%.3f %.3f %.3f %.3f",$1,$3,$4,$5,$6,$7}'
But the thing is, i want the %.3f part to be variable. So in one case it could be %.3f and in another it could be %.3f %.3f %.3f. So i'll just use a static one in my example code for clarity. So if i want 4 of the...
It seems that these two operators are pretty much the same - is there a difference? When should I use = and when ==?
...
I'm trying to create a custom file/check in check out script for external hardrives, however part of the script is from a Linux machine, which I have tested works fine, but uses udevinfo, OS X doesn't have udev, so is there anything that offers the same functionality?
#!/bin/bash
declare -a EXTERNAL_DISKS
declare -a INTERNAL_DISKS
for ...
We are several persons using the same login id on Linux Box.
I want to define my own aliases without interfering with anyone.
In the .bashrc, I define a alias to my bash file defining my own aliases.
alias luc=/full/path/to/my/def_alias_luc.sh
The file /full/path/to/my/def_alias_luc.sh contains
#!/bin/bash
echo ""
echo "Defining Lu...
Can anybody help me how to run a python script through command line?
My python script http://buffis.com/2007/07/25/getting-info_hash-for-xbt-tracker/comment-page-1/
I am using this command /var/www/hash_info.py /var/www/Muha_Album.7912.torrent
I have copied dependency file bencode.py mentioned in article link above. When I execute the...
Sorry if this is better suited at serverfault, but I think it learns more towards the programming side of things.
I have some code that's going into /etc/rc.local to detect what type of touch screen monitor is plugged in and changes out the xorg.conf before launching X. Here is a small snippet:
CURRENT_MONITOR=`ls /dev/usb | grep 'egal...
How do I split a line of text in bash using SOH delimiter?
...
What is a regex I can write in bash for parsing a line and extracting text that can be found between two | (so that would be ex: 1: |hey| 2: |boy|) and keeping those words in some sort of array?
...
Okay so I am having this problem. I write up a script to be run in cygwin on Windows. I've tried a bunch of basic example scripts in case it was my scripts problem.
So I tried this:
#!/bin/bash
echo -e "Enter your name and press [ENTER]: \c"
read var_name
echo "Your name is: $var_name"
Then I will run it and I enter a name for var_n...
I have written a perl script , I just want to give it to every one ,
for that I planned to write a bash script which is used to test the
environment of a user and find whether that environment is capable
of running the perl script.
I want to test the things like
Whether perl has installed in that system
Perl should have the vers...
Hi, I'm trying to write a bash script that "wraps" whatever the user wants to invoke (and its parameters) sourcing a fixed file just before actually invoking it.
To clarify: I have a "ConfigureMyEnvironment.bash" script that must be sourced before starting certain executables, so I'd like to have a "LaunchInMyEnvironment.bash" script th...
I'm using mod_wsgi apache2 adapter for a django site and I like to call some bash process within a view, using the usual
...
p = subprocess.Popen("/home/example.com/restart-tomcat.sh", shell=True)
sts = os.waitpid(p.pid, 0)[1]
...
This code works perfectly from within a usual python shell but does nothing (I can trace right now) when ...
I am trying to check if md5sum or digest exists on solaris and script is used on different machines.
Here is the function in sh script which is called from a ksh script
getMD5cmd ()
{
PATH="${PATH}:/bin:/usr/bin:/usr/sfw/bin:/usr/local/bin:/usr/sbin/bin"
if type -p md5sum;then
MD5CMD=`type -p md5sum`
elif type -p di...
I'm trying to write an alias for cd !!:1, which takes the 2nd word of the previous command, and changes to the directory of that name. For instance, if I type
rails new_project
cd !!:1
the second line will cd into the "new_project" directory.
Since !!:1 is awkward to type (even though it's short, it requires three SHIFTed keys...
Given following command:
echo "1: " | awk '/1/ -F ":" {print $1}'
why does awk output:
1:
...
sed "s/\(.*\)/\t\1/" $filename > $sedTmpFile && mv $sedTmpFile $filename
I am expecting this sed script to insert a tab in font of every line in $filename however it is not. For some reason it is inserting a t instead.. Strange..
...
Okay, I currently use an eggdrop IRC bot on my server. I want to make a bash script to start it up as well as a few other scripts at the same time. All that's left is to make it start, but it won't run as root.
However, I also need to be in the current directory of the file to run it, or it displays an error.
For example:
/home/eggdrop...
I need to compare my input with enter key/return key...
read -n1 key
if [ $key == "\n" ]
echo "@@@"
fi
But this is not working.. What is wrong with this code
...
I need to monitor my audio line-in in linux, and in the event that audio is played, the sound must be recorded and saved to a file. Similiar to how motion monitors the video feed.
Is it possible to do this with bash? something along the lines of:
#!/bin/bash
# audio device
device=/dev/audio-line-in
# below this threshold audio will n...