![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Complex find grep or sed command | sjburden | Shell Programming and Scripting | 3 | 05-31-2008 09:45 PM |
| complex grep command | naamas03 | Shell Programming and Scripting | 0 | 11-21-2007 04:59 AM |
| Substitution of last command | ghazi | Shell Programming and Scripting | 6 | 01-16-2005 07:06 PM |
| vi/vim : complex pattern substitution | c444l | UNIX for Dummies Questions & Answers | 2 | 08-03-2004 10:04 AM |
| advanced/complex uses of the find command | Perderabo | Answers to Frequently Asked Questions | 0 | 05-04-2004 01:13 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
complex command substitution
hi,
I have to execute this line below from within a shell script; simply backquoting it is not doing the trick; it is mangling up all the options; but when i type it out on a command line, it executes cleanly. Please help me in getting this right; $ vlc -I dummy --sout='#transcode{vcodec=mp4v, acodec=mp4a}:std{access=file, mux=mp4, url=temp.mp4} file.avi As you can see, the syntax of the option specification for VLC includes many complex tokens; Can you guide me to get it working from within backquotes? Thanks! |
|
||||
|
oops!
ok, there is no unmatched single quote; thanks a lot for pointing out; this is the corrected command line:
$ vlc -I dummy --sout='#transcode{vcodec=mp4v,acodec=mp4a}:std{access=file,mux=mp4,url=temp.mp4} ' file.avi I got this partially working by simply writing the line in the shell script (without an backquotes). The problem is my temp.mp4 and file.avi are actually inside variables $T and $F; something like this works: #!/bin/sh #do some string manipulation to determine values of $T and $F vlc -I dummy --sout='#transcode{vcodec=mp4v,acodec=mp4a}:std{access=file,mux=mp4,url=temp.mp4} ' "$F" but if I replace $T for temp.mp4, it wont work anymore; I dont care about the return value of this command, so I dont need backquotes; So, the problem has boiled down to - how do I make the shell interpret the $ variable inside those single quotes? Thanks! |
|
||||
|
What you need to do is pre-process the command line within the single quotes, performing variable substution. I don't know about your application, so here is a trivial example which should make it clear.
There is a one line script called z containing the line "print $1" There is a variable within the current shell with the value "z" (a=z) First run z with $a as a parameter and it prints "z" (value substituted) Code:
$ ./z $a $ z Code:
$ ./z '$a' $ z Code:
$ eval ./z '$a' $ z |
|
||||
|
hi all, thanks a lot, I solved the problem with some generous usage of quotes..
vlc -I dummy --sout=""#transcode{vcodec=mp4v,acodec=mp4a}:std{access=file,mux=mp4,url=$T} "" $F did the trick; the problem was that I needed some kind of quotes after --sout= as part of the commad line syntax; |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|