Sponsored Content
Full Discussion: Batch code
Top Forums Shell Programming and Scripting Batch code Post 302739119 by Don Cragun on Monday 3rd of December 2012 02:28:44 PM
Old 12-03-2012
Try something like:
Code:
#!/bin/ksh
n=1
while read -r cmd
do      (cat script;printf "%s\n" "$cmd") > script$n
        n=$((n + 1))
done < commands

I used ksh, but this will work with any POSIX conforming shell.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

batch render

I'm interested in getting unix in my pc, can someone tell me where and how can I get it. I'm a complete virgin about unix, I work in 3d animation and i need unix to make batch rendering work in Maya. Another question is: how do I know what hardware is compatible with unix and do I need any drivers... (1 Reply)
Discussion started by: Vitor
1 Replies

2. Shell Programming and Scripting

rename in batch

example test1 will have m1234567.12a I would like to rename in batch but I don't Please help me on this. cd /a1/a2/a3 test1=$(basename /a1/a2/a3/*.*) >> /tmp/t echo $test1 echo "Extracting 8 th position" >> /tmp/t2 awk '{print substr($1,8,1); }' $test1 >> /tmp/t3 echo "extraction ... (3 Replies)
Discussion started by: kathy18
3 Replies

3. IP Networking

batch file

my requirment is i have to call a batch file from a c++ program that batch file is called with the argument as print.txt print.txt is a text file which should get printed on printer (any printer) when a batch file call is made 1) how to call a batch file in c++ 2) how to print the text... (1 Reply)
Discussion started by: ramneek
1 Replies

4. UNIX for Dummies Questions & Answers

Batch id in UNIX

Hi can any one help me? How to find the "batchid" in UNIX? Regards, Ganapati. :confused: (1 Reply)
Discussion started by: ganapati
1 Replies

5. Shell Programming and Scripting

batch renaming ...

hi all, given a path, for example : /<pwd>/artist/album/ what i would like to do is to rename the album directory like that : /<pwd>/artist/artist | album/ and i would like to do the latter for all the "artist" directories and for all the "album" directories that belong to an artist ... (4 Replies)
Discussion started by: OneDreamCloser
4 Replies

6. UNIX for Advanced & Expert Users

batch file

Hi all I am using tru64 Unix and I want a ready batch file which makes me to change all user passwords at the same time ,instead of changing everyone separately. Please could anyone help me to do that. bye. (1 Reply)
Discussion started by: ahmedbashir
1 Replies

7. Shell Programming and Scripting

Executing a batch of files within a shell script with option to refire the individual files in batch

Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below. I am on a solaris server btw. Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose. ... (2 Replies)
Discussion started by: goddevil
2 Replies

8. Shell Programming and Scripting

Batch download

............. (9 Replies)
Discussion started by: hoo
9 Replies

9. UNIX for Dummies Questions & Answers

SSH batch help

Dear Gurus, I had hundreds of equipments which i can only use SSH to login and retrieve informations. Thus, how should i do that? eg:ssh batch @ echo off ssh <server1>@10.168.1.1 ECHO testing1 exit ssh <server2>@10.168.1.2 ECHO testing2 exit Can the above method used? :) (6 Replies)
Discussion started by: ymeyaw
6 Replies

10. Shell Programming and Scripting

Batch or not if/then

I am having trouble modifying a .sh that allows the user to run different command based of an input. So based on the user input of Y or N a different command is run. Thank you :). #!/bin/bash while true do printf "Is this a batch : " ; read id && break If "$id" = Y, Then... (14 Replies)
Discussion started by: cmccabe
14 Replies
GZEXE(1)						      General Commands Manual							  GZEXE(1)

NAME
gzexe - compress executable files in place SYNOPSIS
gzexe [ name ... ] DESCRIPTION
The gzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them (at a penalty in performance). For example if you execute ``gzexe /bin/cat'' it will create the following two files: -r-xr-xr-x 1 root bin 9644 Feb 11 11:16 /bin/cat -r-xr-xr-x 1 bin bin 24576 Nov 23 13:21 /bin/cat~ /bin/cat~ is the original file and /bin/cat is the self-uncompressing executable file. You can remove /bin/cat~ once you are sure that /bin/cat works properly. This utility is most useful on systems with very small disks. OPTIONS
-d Decompress the given executables instead of compressing them. SEE ALSO
gzip(1), znew(1), zmore(1), zcmp(1), zforce(1) CAVEATS
The compressed executable is a shell script. This may create some security holes. In particular, the compressed executable relies on the PATH environment variable to find gzip and some other utilities (tail, chmod, ln, sleep). BUGS
gzexe attempts to retain the original file attributes on the compressed executable, but you may have to fix them manually in some cases, using chmod or chown. GZEXE(1)
All times are GMT -4. The time now is 02:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy