Sponsored Content
Top Forums Shell Programming and Scripting Totally new to shell scripting Post 302890206 by risarose87 on Tuesday 25th of February 2014 04:53:31 PM
Old 02-25-2014
I forgot about the merge and that was a over look. I thought I was done and forgot about that so I am sorry for now just mentioning that. I had done that because there was information from a message I recieved that I shouldn't have displayed and didn't want it public.
Moderator's Comments:
Mod Comment For threads in these forums to be useful to the general public, a clear description of the problem to be solved, including the formats of input and output files must be given. Samples of the desired input and output are required, and if it isn't obvious from the sample data, a description of the algorithms used to transform the input to the output is also required.

When you first posted your sample data, it contained company private names, addresses, phone numbers, and employee IDs of some of your company's employees and names, phone numbers, addresses, and customer IDs for some of your customers. A moderator spent about an hour expunging private data from that post for you and sent a private message suggesting that you be careful when posting sample data in the future. We hadn't noticed that you had gone back and removed the data (and all descriptions of the data format and all of the sample code that had been used to prepare code to meet your original problem.

Please restore enough of the deleted data and code to make the purpose of this thread clear! If that hasn't happened within 24 hours, this thread will be closed and you will be limited to read-only access to the forums for two weeks.

Sincerely,
Don Cragun

Last edited by Don Cragun; 02-25-2014 at 07:55 PM.. Reason: Note need to maintain purpose of a thread and request reinstatement of crucial thread history.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Totally new unix user

Hi, ive just been given a HP UX c180 to play with, along with a few external hd`s, can anyone recommend me a good place to start learning unix please as i havent got a clue what im doing when it comes to unix. Either web links or book recomendations would be great. I would like to set it up with... (1 Reply)
Discussion started by: Leviathan40
1 Replies

2. UNIX for Dummies Questions & Answers

totally new to unix

I'm trying to write a script, named "worfo" which will read a file in and return, on the screen, the number of words in the file. Also, I am looking to do several extras with this script. I need to allow it to accept the option "-n" which will use all non-alpha characters to delimit words. Also,... (2 Replies)
Discussion started by: adawg1283
2 Replies

3. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

4. AIX

Totally messed up

I have moved the etc/passwd file and we are now unable to get in to Unix - any suggestions? (2 Replies)
Discussion started by: vbagwell
2 Replies

5. Shell Programming and Scripting

Sed if statement (totally stuck) apache

I have a irritating problem with a "if"-statement or what you should call it, in sed. I would love some help here since I am very, very stuck. I have this statement that I want to do: if line contains a: do this if none of the lines contained a: do this The problem with this... (8 Replies)
Discussion started by: hjalle
8 Replies

6. UNIX for Dummies Questions & Answers

Totally brand new to CRON

hi there i am very new to the world of CRON. i would like to know from below the ground up how i can learn abouot cron. where the best tutorials lie. i have an assignment that requires i set up a cron job to download a price file. am i in control of where the price file is downloaded to? (eg to... (2 Replies)
Discussion started by: buzzby
2 Replies

7. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

8. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

9. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

10. IP Networking

Totally stucked in ssh port forwarding

Hello my friends , i am totally stuck in ssh port forwarding topic i had learn iptables and other networking topic without any problem but ssh port forwarding is headache 1. local port = what is this ? is this incoming traffic or outgoing traffic 2. remote port = same as above 3. dynamic... (2 Replies)
Discussion started by: rink
2 Replies
ST(3)							     Library Functions Manual							     ST(3)

NAME
libst - Sound Tools : sound sample file and effects libraries. SYNOPSIS
cc file.c -o file libst.a DESCRIPTION
Sound Tools is a library of sound sample file format readers/writers and sound effects processors. Sound Tools includes skeleton C files to assist you in writing new formats and effects. The full skeleton driver, skel.c, helps you write drivers for a new format which has data structures. The simple skeleton drivers help you write a new driver for raw (headerless) formats, or for formats which just have a simple header followed by raw data. Most sound sample formats are fairly simple: they are just a string of bytes or words and are presumed to be sampled at a known data rate. Most of them have a short data structure at the beginning of the file. INTERNALS
The Sound Tools formats and effects operate on an internal buffer format of signed 32-bit longs. The data processing routines are called with buffers of these samples, and buffer sizes which refer to the number of samples processed, not the number of bytes. File readers translate the input samples to signed longs and return the number of longs read. For example, data in linear signed byte format is left- shifted 24 bits. This does cause problems in processing the data. For example: *obuf++ = (*ibuf++ + *ibuf++)/2; would not mix down left and right channels into one monophonic channel, because the resulting samples would overflow 32 bits. Instead, the ``avg'' effects must use: *obuf++ = *ibuf++/2 + *ibuf++/2; Stereo data is stored with the left and right speaker data in successive samples. Quadraphonic data is stored in this order: left front, right front, left rear, right rear. FORMATS
A format is responsible for translating between sound sample files and an internal buffer. The internal buffer is store in signed longs with a fixed sampling rate. The format operates from two data structures: a format structure, and a private structure. The format structure contains a list of control parameters for the sample: sampling rate, data size (bytes, words, floats, etc.), encoding (unsigned, signed, logarithmic), number of sound channels. It also contains other state information: whether the sample file needs to be byte-swapped, whether fseek() will work, its suffix, its file stream pointer, its format pointer, and the private structure for the format . The private area is just a preallocated data array for the format to use however it wishes. It should have a defined data structure and cast the array to that structure. See voc.c for the use of a private data area. Voc.c has to track the number of samples it writes and when finishing, seek back to the beginning of the file and write it out. The private area is not very large. The ``echo'' effect has to malloc() a much larger area for its delay line buffers. A format has 6 routines: startread Set up the format parameters, or read in a data header, or do what needs to be done. read Given a buffer and a length: read up to that many samples, transform them into signed long integers, and copy them into the buffer. Return the number of samples actually read. stopread Do what needs to be done. startwrite Set up the format parameters, or write out a data header, or do what needs to be done. write Given a buffer and a length: copy that many samples out of the buffer, convert them from signed longs to the appropri- ate data, and write them to the file. If it can't write out all the samples, fail. stopwrite Fix up any file header, or do what needs to be done. EFFECTS
An effects loop has one input and one output stream. It has 5 routines. getopts is called with a character string argument list for the effect. start is called with the signal parameters for the input and output streams. flow is called with input and output data buffers, and (by reference) the input and output data buffer sizes. It processes the input buffer into the output buffer, and sets the size variables to the numbers of samples actually processed. It is under no obligation to read from the input buffer or write to the output buffer during the same call. If the call returns ST_EOF then this should be used as an indication that this effect will no longer read any data and can be used to switch to drain mode sooner. drain is called after there are no more input data samples. If the effect wishes to generate more data samples it copies the generated data into a given buffer and returns the number of samples generated. If it fills the buffer, it will be called again, etc. The echo effect uses this to fade away. stop is called when there are no more input samples to process. stop may generate output samples on its own. See echo.c for how to do this, and see that what it does is absolutely bogus. COMMENTS
Theoretically, formats can be used to manipulate several files inside one program. Multi-sample files, for example the download for a sam- pling keyboard, can be handled cleanly with this feature. PORTABILITY PROBLEMS
Many computers don't supply arithmetic shifting, so do multiplies and divides instead of << and >>. The compiler will do the right thing if the CPU supplies arithmetic shifting. Do all arithmetic conversions one stage at a time. I've had too many problems with "obviously clean" combinations. In general, don't worry about "efficiency". The sox.c base translator is disk-bound on any machine (other than a 8088 PC with an SMD disk controller). Just comment your code and make sure it's clean and simple. You'll find that DSP code is extremely painful to write as it is. BUGS
The HCOM format is not re-entrant; it can only be used once in a program. The program/library interface is pretty weak. There's too much ad-hoc information which a program is supposed to gather up. Sound Tools wants to be an object-oriented dataflow architecture. October 15 1996 ST(3)
All times are GMT -4. The time now is 08:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy