08-15-2007
One way:
$ num=abcdefghij
$ num2=${num#${num%?????}}
$ echo $num2
fghij
$
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have to copy an array to a temp variable and back after doing some functions. I am trying to see if it is possible to do without while loops.My closest try was
set -A temp ${THE_ARRAY}
# restore array after some actions
set -A THE_ARRAY ${temp}
The problem with above is that, the new... (1 Reply)
Discussion started by: vijay1985
1 Replies
2. Shell Programming and Scripting
hi all,
i need an urgent help for writing a shell script which will extract out and print a substring which is the shortest substring from the given string where first and last character of that substring will be given by the user.
for e.g.
if str="abcdpqracdpqaserd"
now if the user gives 'a'... (18 Replies)
Discussion started by: pankajd
18 Replies
3. Shell Programming and Scripting
My Korn shell script below is giving me the following error: ./test.ksh: 0403-057 syntax error at line 7 : 'then' is not matched.
Can anyone provide a quick solution as to why the error is occurring? Thanks.
#!/usr/bin/ksh
typeset -i RecCount
typeset -i RecCount2
RecCount=`db2 -x "select... (23 Replies)
Discussion started by: sasaliasim
23 Replies
4. Shell Programming and Scripting
I got the task writting Korn Shell script to automate the tuxedo login so that users neednot have to enter options manually. I have done that using expect tool from the Unix but my manger told me its not secure so you have to do that using Kornshell without using Expect. Here is the way to login to... (0 Replies)
Discussion started by: pareshan
0 Replies
5. Shell Programming and Scripting
In a Korn shell script I have,
cat ../header | sed -e 's/flag1/$cnumb/g' > header.txt
The header is short
{{Company flag1}}
But the result in header.txt is
{{Company $cnumb}}
The value of $cnumb is 120. I am trying to get the value of $cnumb into the header.
I have tried /'$cnumb'/g,... (10 Replies)
Discussion started by: jcarrott
10 Replies
6. Shell Programming and Scripting
Using the KSH, write a shell script called display_by_length, which takes an absolute pathname to a directory and displays all ordinary files in the directory ordered by their length; for each file listed, display the name of the file and its length - nothing else. Extend this script to take an... (1 Reply)
Discussion started by: babuda0059
1 Replies
7. Shell Programming and Scripting
i am a beginner i m learning shell by myself
i have problem writing a korn shell that takes an absolute pathname to directory and display all ordinary files in the directory ordered by their length.
i was thinking use grep ls sort and sed. maybe, i m wrong! can someone tell me? (2 Replies)
Discussion started by: babuda0059
2 Replies
8. Shell Programming and Scripting
Guys, i'm new to shell scripting. Here's what i need.
I need a shell script which would read a file containing only 1 line which never changes.
File containts -
SQL_Mgd_Svc_ELONMCL54496 |EMEA\brookkev, EMEA\fieldgra, EMEA\tidmamar, EMEA\attfiste, EMEA\baldogar, EMEA\clarkia2, EMEA\conwasha,... (9 Replies)
Discussion started by: butterfly20
9 Replies
9. UNIX for Dummies Questions & Answers
Hi all,
Just looking for a simple if statement that searches for a substring within a varaible, and then performs some function.
Problem is that I need it to work in Korn shell
$var = *string* does not work in Korn
i="xxxxxx00.00yyyyy.zzzzz"
want to find 00.00 (2 Replies)
Discussion started by: jgrosecl
2 Replies
10. Shell Programming and Scripting
Hi all,
I am new to scripting.
I have a file with colon separated values called mylist.txt
cat mylist.txt
192.123.76.89:lmprod89
162.122.20.28:lmtstserver28
10.80.32.139:hewprod139
.
.
using our internal os utility (called mvsping) we need to check all these servers if they are... (6 Replies)
Discussion started by: kraljic
6 Replies
lav2wav(1) MJPEG tools manual lav2wav(1)
NAME
lav2wav - Extract the audio out of MJPEG container files to stdout
SYNOPSIS
lav2wav [-s num] [-c num] [-v num] [-I] [-R] [-r samplerate, bitesize, channels] lavfile1 [lavfile2 ... lavfileN]
DESCRIPTION
lav2wav can be used to extract the audio to stdout. This output goes to stdout and can be saved as a wav file or piped to another sound
processing tool that is able to handle the wav format. This can be mp2enc and toolame for mpeg layer 2 audio, or for example lame for mpeg
layer 3 audio.
The input files may be any combination of AVI (.avi), Quicktime (.qt) or editlist files so long as they are all lavtools- readable (e.g.
MJPEG-encoded AVI/Quicktime or DV type 2 AVI).
OPTIONS
lav2wav accepts the following options:
-s num
Start extracting at video frame (num)
-c num
Extract (num) frames of audio
-v num
Verbosity level (0, 1 or 2)
-I Ignore unsupported bitrates/bits per sample
-R If the file does not contain any sound. lav2wav will create silence with 44100kHz Sampelrate, 16 Bit audio bitsize and 2 Chanels
-r sr,bs,ch
If the file does not contain any sound lav2wav will generate silence with the values you supply the samplerate (sr), audio-bitsize
(bs) and channel (ch).
BUGS
The "WAV" file format (technically: RIFF) is really very much less than ideal for a tool intended to be used in pipelines as lav2wav is.
The problem is that the header includes a field specifying the length of the file. This can't be filled in except by seeking back to the
begining and over-writing. If the output is unseekable (e.g. pipe) lav2wav simply writes a large length into the header and leaves it at
that. Most tools like sox(1) or mp2enc(1) either ignore the length field anyway or only give a warning.
The audio length is inacurate calculated when lav2wav generates silence. This happens only if you have NTSC framerate and than it creates
for every hour of video 1.1498sec too less of silence.
AUTHOR
This man page was written by Bernhard Praschinger.
If you have questions, remarks, problems or you just want to contact the developers, the main mailing list for the MJPEG-tools is:
mjpeg-users@lists.sourceforge.net
For more info, see our website at
http://mjpeg.sourceforge.net
SEE ALSO
mjpegtools(1), mp2enc(1), sox(1)
MJPEG Linux Square 2 June 2001 lav2wav(1)