07-04-2012
@jgt: Really funny...
Quote:
Originally Posted by
methyl
@jgt
[..]The "short solution" relies on the exponential multi-pass technique and utilises a magic Shell with unlimited command line length. [..]
Although it may be good to note that command line length does not really play a role in this case, since "for" is a shell keyword and not an external command, so the length of the list should be more or less limited by memory...
Quote:
Originally Posted by
alister
[..]I don't know for certain, but my first impulse is to blame GNU Bash. I've seen that idiom recommended as the correct way to work around the fact that the final command in a bash pipeline runs in a subshell[..]
It is not only bash, dash and Bourne shell do this too. It is also not specified by Posix, so ksh is the exception..
Last edited by Scrutinizer; 07-04-2012 at 06:42 PM..
6 More Discussions You Might Find Interesting
1. Programming
helo my protocol format is given below
{ destno,mode,no.of packet,pktsize,,pktno,textsize,CRC}
description:- { is starting flag
destno - 4bytes
mode - 1 byte
no.of pkt - 4byes
pktsize - 6 bytes
... (1 Reply)
Discussion started by: amitpansuria
1 Replies
2. Shell Programming and Scripting
hi all,
Can any 1 help me translate this korn shell code to C shell code :
email=$(grep "^$1" $folder/config_2.txt | awk '{print $2'})
In config_2.txt the content is :
which mean in korn shell , $1=groupname and $2=email address.
Now i need to write in C shell script,when i set the... (2 Replies)
Discussion started by: proghack
2 Replies
3. UNIX for Dummies Questions & Answers
01,011600033,011600033,110516,0834,2,90,,2/
02,011600033,011103093,1,110317,0834,,2/
03,105581,,015,+00000416418,,,901,+00000000148,,,922,+000000
00354,,/
03,113806,,015,+00000559618,,,901,+00000000096,,,922,+000000
00621,,/
88,902,+0000000025218,,/... (1 Reply)
Discussion started by: sgoud
1 Replies
4. Shell Programming and Scripting
Hi,
I want to remove the following code from Source files (or replace the code with empty.) from all the source files in given directory.
finally {
if (null != hibernateSession && hibernateSession.isOpen()) {
//hibernateSession.close();
}
}
It would be great if the script has... (2 Replies)
Discussion started by: hareeshram
2 Replies
5. Linux
Hi ,
I have a code where i am using a infinite while loop . some thing like below
while
do
if
then
#go to line 20
fi
command 1;
command 2;
#line 20:
sleep 34; (5 Replies)
Discussion started by: Paarth
5 Replies
6. UNIX for Advanced & Expert Users
I have about 12,000,000 mod files I'm trying to turn into a test of "unlimited cloud storage" by running them all through VLC and blowing them into mp3 files. I can get this to work serially but when trying to use openMPI or Parallel, something in the syntax is tripping it up some. Here is an... (1 Reply)
Discussion started by: sparticus414
1 Replies
OPEN(1) Linux 1.x OPEN(1)
NAME
open - start a program on a new virtual terminal (VT).
SYNOPSIS
open [-c vtnumber] [-s] [-u] [-l] [-v] [--] command command_options
DESCRIPTION
open will find the first available VT, and run on it the given command with the given command options, standard input, output and error are
directed to that terminal. The current search path ($PATH) is used to find the requested command. If no command is specified then the envi-
ronment variable $SHELL is used.
OPTIONS
-c vtnumber
Use the given VT number and not the first available. Note you must have write access to the supplied VT for this to work.
-s Switch to the new VT when starting the command. The VT of the new command will be made the new current VT.
-u Figure out the owner of the current VT, and run login as that user. Suitable to be called by init. Shouldn't be used with -c or -l.
-l Make the command a login shell. A - is prepended to the name of the command to be executed.
-v Be a bit more verbose.
-w wait for command to complete. If -w and -s are used together then open will switch back to the controlling terminal when the command
completes.
-- end of options to open.
NOTE
If open is compiled with a POSIX (Gnu) getopt() and you wish to set options to the command to be run, then you must supply the end of
options -- flag before the command.
EXAMPLES
open can be used to start a shell on the next free VT, by using the command:
open bash
To start the shell as a login shell, use:
open -l bash
To get a long listing you must supply the -- separator:
open -- ls -l
SEE ALSO
login(1), doshell(8), switchto(1).
AUTHOR
Jon Tombs <jon@gtex02.us.es or jon@robots.ox.ac.uk>
-w idea from "sam".
19 Jul 1996 V1.4 OPEN(1)