Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Identifying the commands creating subshells Post 302594120 by pandeesh on Monday 30th of January 2012 01:35:10 PM
Old 01-30-2012
Identifying the commands creating subshells

Hi all,

This is the basic question.
I have read many books which advised to avoid creating sub shells.
e.g: use
Code:
wc -l<filename

rather than using
Code:
cat file|wc -l

.
So, how to identify whether a command creates subshell or not?
so,is it better to use
Code:
tail -n+1 file

in stead of using cat.
Whether tail or head creates sub shells?
Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Killing parent shells from subshells (KSH)

Hi all, I have a shell script which calls other shell scripts, depending on the input. Within a.sh, I have a command which calls b.sh (ie. ksh b.sh) Normally, we use the exit function to terminate a shell. However, if I choose to call exit from b.sh, I will return to the parent shell who... (4 Replies)
Discussion started by: rockysfr
4 Replies

2. UNIX for Dummies Questions & Answers

creating your own commands

hi, i have to type certain commands again and again eg: ps -ef | grep xyz is there any way to replace the whole command by a short form like i just do : $ psl and it give me the same output as $ps -ef | grep xyz where can we store these commands ..... on unix system and create... (2 Replies)
Discussion started by: kukretiabhi13
2 Replies

3. Shell Programming and Scripting

Question regarding shells and subshells when a script is run

I have the following script running with nohup on one of my servers: #!/bin/bash #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ #set log number #i=1 #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ #Check if log exits, if so incrememnt log number up so we don't clobber #while... (8 Replies)
Discussion started by: DeCoTwc
8 Replies

4. Ubuntu

Creating terminal commands

I've written a program in C, called count_0.1 which is essentially a word count program. I want to be able to use it as a command in the terminal (by typing in count), like when you type in ls, you don't have to go to a directory, find an executable and type in: ./ls I've tried: Adding... (1 Reply)
Discussion started by: usernamer
1 Replies

5. Homework & Coursework Questions

Creating a .profile, displaying system variables, and creating an alias

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Here is what I am supposed to do, word for word from my assignment page: 1. Create/modify and print a... (2 Replies)
Discussion started by: Jagst3r21
2 Replies

6. Shell Programming and Scripting

Identifying dupes within a database and creating unique sub-sets

Hello, I have a database of name variants with the following structure: variant=variant=variant The number of variants can be as many as thirty to forty. Since the database is quite large (at present around 60,000 lines) duplicate sets of variants creep in. Thus John=Johann=Jon and... (2 Replies)
Discussion started by: gimley
2 Replies

7. UNIX for Dummies Questions & Answers

Understanding the concept behind subshells

Can someone post a "for dummies" explanation on how subshells work? Let's say I want to get a couple of pieces of info from the /etc/passwd file and set them as variables to be echo'd back after all data is gathered. something like for i in ${grep 5000 /etc/passwd | cut -d : -f 5}... (5 Replies)
Discussion started by: flyboynm
5 Replies

8. Shell Programming and Scripting

Run Shell Commands after creating MYSQL Connection

Hi, I am trying to make a Shell Script using which I will update around 10K records in MySQL db each night. For that, I am currently doing the following command in FOR LOOP: mysql -D $MASTER_DB_NAME -h $MASTER_DB_HOST -u $MASTER_DB_USER -p$MASTER_DB_PASSWD -e "$SQL_Query" This command is... (2 Replies)
Discussion started by: rahulmittal87
2 Replies

9. Shell Programming and Scripting

Errexit APPEARS set in subshells

Hi there, Everyone knows that errexit is NOT inherited by subshells. But does anyone know why errexit still appears as set with set +o? The following example highlights the fact that errexit appears set in a subshell (set +o) even though it's actually unset (it does NOT exit with false). $... (0 Replies)
Discussion started by: chebarbudo
0 Replies

10. Shell Programming and Scripting

Export variables to subshells

So i have a script that is like this: #!/bin/sh VARA="elementary 1 elementary 2 nursery A nursery B highschool AZ" echo "${ContentOfADifferentSCRIPT}" | sh i do not have control over the script that is inside the variable "${ContentOfADifferentSCRIPT}". however, i know that the... (3 Replies)
Discussion started by: SkySmart
3 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 01:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy