Search Results

Search: Posts Made By: jelloir
11,683
Posted By jelloir
Thanks very much! In the end I got it...
Thanks very much!

In the end I got it working as follows (using ffmpeg):

find ./ -type f -name "*.ogg" -exec sh -c 'ffmpeg -i "{}" "$(dirname "{}")/$(basename "{}" .ogg).mp3"' \;
11,683
Posted By jelloir
basename not working as expected from find -exec
I have the following files in a directory

> ls -1 /tmp/test/dir/
file with spaces 1.ogg
file with spaces 2.oggI am running the following to echo the filenames but alter the file extension on the...
24,124
Posted By jelloir
Thanks chihung, I tried your suggestion but it...
Thanks chihung, I tried your suggestion but it still fails, so the exit doesn't appear to be the problem. If I check the return value from the ssh command it is 0, so i'm stumped? Thanks for the...
24,124
Posted By jelloir
while loop stops after first iteration - remote ssh exit command problem?
I have written the following script to update some Debian boxes.

#!/bin/bash

mxg_hosts_file="/etc/mxg/ssh-hosts"

while read line ; do
mxg_host="$(echo ${line} | awk -F":" '{print $1}')"...
25,785
Posted By jelloir
You Rule!! Thanks
You Rule!! Thanks
25,785
Posted By jelloir
awk if statement to evaluate string and compare
I have the following simplified code that I am planning on putting into a larger shell script. I have been butchering it to try and make work amongst google searches and reading awk documentation....
Forum: Programming 07-05-2011
2,442
Posted By jelloir
Python 3.1 TypeError explanation needed
Could someone explain why Python 3.1 errors out below? Do I need an additional module that's not required in 3.2 perhaps? I need to use 3.1 as it's the version available on a server I am using.
...
11,992
Posted By jelloir
:o, haha so simple. I did read the man page but...
:o, haha so simple. I did read the man page but obviously not thoroughly enough.

Thanks for that.
11,992
Posted By jelloir
grep regex, match exact string which includes "/" anywhere on line.
I have a file that contains the 2 following lines (from /proc/mounts)

/dev/sdc1 /mnt/backup2 xfs rw,relatime,attr2,noquota 0 0
/dev/sdb1 /mnt/backup xfs rw,relatime,attr2,noquota 0 0

I need to...
14,484
Posted By jelloir
So that means it will run the trap on normal exit...
So that means it will run the trap on normal exit of the script, assuming EXIT is used... Looks like I will have to rethink how my cleanup operates as I had planned on only running the trap on...
14,484
Posted By jelloir
How to trap set -o nounset in bash
I have a bash script using "set -o nounset" to prevent unset variables.

However I have created a trap to run some cleanup options upon exit of the script which works fine for CTRL-C, etc. but if...
11,209
Posted By jelloir
Perfect. the "builtin cd" is what I needed and...
Perfect. the "builtin cd" is what I needed and placed it in the function and it works. I was having the same loop problem using an alias and did not have the "shopt -s expand_aliases" option.

So...
11,209
Posted By jelloir
Thanks, that works. I would like to have...
Thanks, that works.

I would like to have used cd as the function name but using cd as the function calls cd which is now the function, i.e. loop and stuck.

cd is a builtin so cannot provide the...
11,209
Posted By jelloir
Make pwd print escape character
I decided I wanted to have the cd command print my full working directory after each cd command, so I put this cw command in .bashrc as a function.

cw ()
{
cd "${1}"
pwd
}While...
6,714
Posted By jelloir
Extract section of file based on word in section
I have a list of Servers in no particular order as follows:

virtualMachines="IIBSBS IIBVICDMS01 IIBVICMA01"And I am generating some output from a pre-existing script that gives me the following...
7,410
Posted By jelloir
tar "--totals" writes to stderr not stdout?
I want to use the "--totals" option in GNU tar for some reporting, however I have discovered that it writes the output to stderr not stdout and I would like to know why. This is running from BASH.
...
12,458
Posted By jelloir
bash: closing file descriptors from a process
Below is a test script to illustrate a problem from a larger script I am writing.

$ cat /tmp/loggingtest
#!/bin/bash

lvcreate -s -l 100%FREE -n var-data-snapshot vg00/var-data 2> >(logger -t...
6,035
Posted By jelloir
Great! that got it, Thanks Scrutinizer. ...
Great! that got it, Thanks Scrutinizer.

I'll do some reading up on eval to understand how eval helped.

$ bash -x /tmp/exclude
+ exclude='Archive PST,SystemState'
++ IFS=,
++ for excl in...
6,035
Posted By jelloir
Actually, I cannot get this to work either... I...
Actually, I cannot get this to work either... I am using:

#!/bin/bash

exclude='Archive PST,SystemState'

#rsyncExclusions=$(IFS=,;for excl in ${exclude}; do printf "%s" "--exclude=\"$excl\"...
6,035
Posted By jelloir
I can't seem to get this to work. I am using...
I can't seem to get this to work.

I am using the following...

#!/bin/bash

exclude='Archive PST,SystemState'

echo "${exclude}" | tr ',' '\n' | while read exclusion
do
...
6,035
Posted By jelloir
problem with echo inserting single quotes
Consider the following script:

#!/bin/bash

exclude='Archive PST,SystemState'

IFS=$","
rsyncExclusions=$(for exclude in ${exclude}; do echo -n -e --exclude=\"${exclude}\"\ ; done)
unset...
11,122
Posted By jelloir
Nice work! I simply hadn't thought of using...
Nice work!

I simply hadn't thought of using syslog itself to send it to /dev/null.

That will work fine for my script.

Thankyou very much for taking the time to respond John1212, this is what...
11,122
Posted By jelloir
$ logger -p local1.notice -t mugsyback.debug TEST...
$ logger -p local1.notice -t mugsyback.debug TEST
$ grep TEST /var/log/syslog
Sep 6 09:41:35 debvelopment mugsyback.debug: TEST

Logger itself works fine, including in the function.
11,122
Posted By jelloir
Sep 6 08:44:52 debvelopment mugsyback.crit:...
Sep 6 08:44:52 debvelopment mugsyback.crit: Broken pipe
11,122
Posted By jelloir
Thanks again john1212, I had actually tried that...
Thanks again john1212, I had actually tried that already but it still fails with a pipe error.

I need something that handles the output like logger does but allows me to redirect it to /dev/null.
Showing results 1 to 25 of 49

 
All times are GMT -4. The time now is 08:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy