Sponsored Content
Full Discussion: shell variables advanced
Top Forums Shell Programming and Scripting shell variables advanced Post 302340072 by wakatana on Sunday 2nd of August 2009 10:25:41 AM
Old 08-02-2009
OK I made it!

Code:
#!/bin/bash
FS=$'\n'
for x  in *.mp3
do
 var="`echo -ne $x | sed -ne 's/\([0-9]\{2\}\) - .* - .*[0-9]\{3\}\.mp3/track\1.mp3/gp' `"
 cp "$x" "$var"
done
unset IFS

but is stil strange of me why
Code:
var="`echo -ne $x | sed -ne 's/\([0-9]\{2\}\) - .* - .*[0-9]\{3\}\.mp3/track\1.mp3/gp' 
is not the same thing like i did before
var="`sed -ne 's/\([0-9]\{2\}\) - .* - .*[0-9]\{3\}\.mp3/track\1.mp3/gp' "$x"`"



---------- Post updated at 04:25 PM ---------- Previous update was at 04:23 PM ----------

Quote:
Originally Posted by edidataguy
Change the line as follows:
Code:
 echo $x | sed -ne 's/\([0-9]\{2\}\) - .* - .*[0-9]\{3\}\.mp3/track\1.mp3/gp'

yes you right Smilie i did not read your last post, we both discovered the same thing Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using shell variables In awk

Oh its not my day for syntax... cat gzipsize.txt | awk '{print "echo",$1,$2} > master.txt I have read a lot about the awk -v but haven't been able to get it to work. I have a variable in my script and I'm looking just to push it into the awk after the $2 (or anywhere would do)!!! Every... (11 Replies)
Discussion started by: nortypig
11 Replies

2. Shell Programming and Scripting

variables in shell

hi, i'm new in shell scripting and i'm working on bash on solaris 5.9 after try many stuff with unexpected results, i wonder: it is not posible in bash, to use a variable that was created inside a loop, out of it? i mean, for instance: cat mytext | \ while read text do viko=$text... (2 Replies)
Discussion started by: viko
2 Replies

3. Post Here to Contact Site Administrators and Moderators

Where can I download the VTC - Unix Shell Scripting Advanced complete video

Where can I download the VTC - Unix Shell Scripting Advanced complete video. I don't know in which thread I should post this question.Plz help me out, or just tell me the link in the reply to this post. Thanks in advance. (0 Replies)
Discussion started by: villain41
0 Replies

4. Shell Programming and Scripting

$0 shell variables

Would appreciate if someone can explain the ${0##*/} line. What does it do? I am aware that $0 is the script name, $# is number of arguments passed in, $* is all the arguments. With the curly brackets {} added in, what's the eventual effect? Does ${0##*/} actually equals $0$#$*? (something like... (3 Replies)
Discussion started by: new2ss
3 Replies

5. Shell Programming and Scripting

Advanced error handling in shell scripts

Hi all I've got a question regarding error handling in shell scripts. My background is mainly object oriented programming languages, but for a year or so I've been doing more and more (bash) shell scripting (which I quite enjoy by the way). To handle errors in my scripts I... (3 Replies)
Discussion started by: script_man
3 Replies

6. Shell Programming and Scripting

Shell advanced syntax?

I am not an expert of shell scripting, but I can do some simple things. Now, I read a script written by others and I need some help from the experts of this forum. Please help me to understand what is going on in this cycle: if ; then ] && \ export... (25 Replies)
Discussion started by: alt
25 Replies

7. Homework & Coursework Questions

Trouble with Advanced Shell Programming

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am working on a hands on project. We are creating a script for a corporate phone list. The project I am... (2 Replies)
Discussion started by: SarahBelle7858
2 Replies

8. Shell Programming and Scripting

awk - take variables out to shell

Hi, How could we take the value of awk variables out to shell? I know the following methods 1. awk '{print $1}' < file | read a echo $a 2. a=`awk '{print $1}' < file` echo $a Please let me know if there are any other methods. Also, how do we take more than 1 variable value... (4 Replies)
Discussion started by: Thumban
4 Replies

9. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

10. Shell Programming and Scripting

How to write config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies
qmp3join(1)							 quelcom man pages						       qmp3join(1)

NAME
qmp3join - join mp3 files SYNOPSIS
qmp3join [option]... file1 file2... DESCRIPTION
qmp3join reads a list of mp3 files and joins them in one mp3 file in the specified order. some conditions must be met for the parameters of each of the files (see NOTES section). OPTIONS
-f, --force force join bypassing bit rate checks. by default, to join two files they must be both vbr (have variable bit rate) or have the same bit rate. using this option you can skip this check. -h, --help show a brief help and exit. -o <outfile>, --output=<outfile> outfile is the name of the file where all the frames will be copied. if this option is not used, the frames from the second to the last file of the list will be appended to file1. -v, --verbose show which operations are done. -V, --version show version and exit. NOTES
(all) the following parameters are required to be common for two mp3 files to be joined: [fill this!!!]. also, about the bit rate parame- ter, both mp3 must have the same value or (both) must have a variable bit rate. this restriction would be by-passable with the --force flag. before joining, all the streams are tested for validity. this is a time consuming operation. in any case, qmp3join can be viewed like a better but restrictive cat for mp3 files, due to the mp3 file format characteristics. BUGS
tests have been done only with mpeg version 1 layer iii streams, though it may (or not) work with other versions/layers. AUTHOR
dmanye@etse.urv.es http://www.etse.urv.es/~dmanye/quelcom/quelcom.html SEE ALSO
qmp3info(1), qmp3cut(1), qmp3check(1), qmp3report(1) qwavinfo(1), qwavjoin(1), qwavcut(1), qwavsilence(1), qwavfade(1), qwavheaderdump(1) quelcom 0.4.0 february 2001 qmp3join(1)
All times are GMT -4. The time now is 10:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy