Sponsored Content
Top Forums Shell Programming and Scripting Manually built the code below. Post 302565563 by otheus on Tuesday 18th of October 2011 08:08:54 AM
Old 10-18-2011
Yup. You can do this by making a "hereto" document and replacing your CHANGE HERE parameters with shell variable names, like $LINECOUNT and $FILENAME. THen wrap that in a big loop.

But m4 offers a sleeker way. Name your placeholders as above but without the $ sign and save the changes to a file, say matlab.tmpl
Code:
cat file_list.txt |
while read linecount filename; do
   m4 -DFILENAME="$filename" -DLINECOUNT="$linecount" matlab.tmpl
done > bigfile.m


Last edited by otheus; 10-18-2011 at 09:13 AM.. Reason: I thought m4 could handle macros beginning with $. It cannot
This User Gave Thanks to otheus For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk built in variables

Dear experts I am learning awk command through some books on Solaris 8. I have tested the folloing command awk 'BEGIN { print match ("And" , /d/)}' then the result is as following awk: syntax error near line 1 awk: illegal statement near line 1 Could you please help on this and just... (4 Replies)
Discussion started by: Reza Nazarian
4 Replies

2. Shell Programming and Scripting

BUILT-IN command scripts

I am new to Unix scripting. I would like to know if someone can point me to a site which lists any built-in commands in there scripted form. I thought to start with the basics and learn from example. Thanks JSP (2 Replies)
Discussion started by: JSP
2 Replies

3. Shell Programming and Scripting

ksh built-in function

Does anyone know why the following expression return an error ] while the following one not ?? Thanks (1 Reply)
Discussion started by: solea
1 Replies

4. Gentoo

Which GCC Built My Kernel?

I'm playing around with the kqemu accelerator for the QEMU virtualization software. I can't remember which version of gcc I used to build my kernel. I have 3.4.6 and 4.1.1 on this (Gentoo) system. I seem to remember there is some command I can run against binaries that will tell me what gcc (and... (5 Replies)
Discussion started by: deckard
5 Replies

5. Shell Programming and Scripting

built-in hex editor?

I'm using Mac OS 10.2.2 and I need to find a command line hex editor. I figure there's already one built-in, but I just don't know enough about Unix, yet. Basically, what I want to do is tell the hexeditor to open a file, replace a specific offset with a new value, then put the resulting file... (7 Replies)
Discussion started by: Loriel
7 Replies

6. Linux

distro with built in java.

i installed fedora core6, then came to know that java is not supplied with it, can u help me by naming some distros with built in java, does RHL5+ has it? (2 Replies)
Discussion started by: zius_oram
2 Replies

7. Shell Programming and Scripting

bash built-in

Is there any command or VARIABLE in unix to display only bash builtin commands?. Some days back I worked on that, but now I do not remember. Can anyone please reply for this?... (4 Replies)
Discussion started by: gwgreen1
4 Replies

8. AIX

OpenSSH built in chroot facility

Hi all, I'm trying to set up a chroot sftp using OpenSSH. But I'm still having problems. I'm using AIX 5.3 My system and OpenSSH version as follows host1:/>oslevel 5.3.0.0 host1:/>oslevel -r 5300-10 host1:/>ssh -V OpenSSH_5.0p1, OpenSSL 0.9.8h 28 May 2008 host1:/>lslpp -l | grep open... (2 Replies)
Discussion started by: h@foorsa.biz
2 Replies

9. UNIX for Advanced & Expert Users

Kernel Modules Not geting built

I installed in VM the Mandriva Linux with 2.6.27 kernel. But presently when I fire make the modules .ko does not get built. I get the following output on firing command in the kernel module folder. $ make Building first_driver.c ... make: Entering directory... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

10. UNIX for Dummies Questions & Answers

Using gFORTRAN to compile something built for g77

Hi, I am having a problem compiling a program with gfortran. The program compiles with g77 and f77 but I don't have those. I edited the makefile from FC = g77 to FC = gfortran but when I run it I get a slew of undefined reference errors. Any suggestions? (8 Replies)
Discussion started by: butson
8 Replies
mouse_setscale(3)						Svgalib User Manual						 mouse_setscale(3)

NAME
mouse_setscale - sets a mouse scale factor SYNOPSIS
#include <vgamouse.h> void mouse_setscale(int s); DESCRIPTION
This routine sets the scale factor between the motion reported by the mouse and the size of one pixel. The larger the scale is, the slower the mouse cursor appears to move. The scale may be set to any non-zero integer. Negative scales result in flipped axes. Currently, there is no support for scale factors between 0 and 1 which would make the mouse appear faster than usual. If this routine is never called, scale s defaults to 1. SEE ALSO
svgalib(7), vgagl(7), libvga.config(5), eventtest(6), mouse_init(3), mouse_close(3), mouse_getposition_6d(3), mouse_getx(3), mouse_setposi- tion(3), mouse_setwrap(3), mouse_setxrange(3), mouse_update(3), mouse_waitforupdate(3), vga_setmousesupport(3), mouse_seteventhandler(3), vga_waitevent(3) AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The exact source of the referenced function as well as of the original documentation is unknown. It is very likely that both are at least to some extent are due to Harm Hanemaayer <H.Hanemaayer@inter.nl.net>. Occasionally this might be wrong. I hereby asked to be excused by the original author and will happily accept any additions or corrections to this first version of the svgalib manual. Svgalib (>;= 1.2.11) 27 July 1997 mouse_setscale(3)
All times are GMT -4. The time now is 03:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy