Sponsored Content
Full Discussion: $line command problem
Top Forums Shell Programming and Scripting $line command problem Post 302080998 by aigles on Friday 21st of July 2006 10:06:53 AM
Old 07-21-2006
Try something like this :

Code:
find / |
while read line
   echo $line > stdout.file
done

The stdout.file will allways contains the last line printed by find on stdout

Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem with command line

i have a command line that looks like this: my_command -a -b -c -d"foo bar" "./run this" param1 param2 I'm using getopt to pharse parameters -a -b -c -d. after that i would like to execute "./run this" param1 param1 (which is places after --) but I'm loosing quotas around ./run this. How can i... (0 Replies)
Discussion started by: sopel39
0 Replies

2. Shell Programming and Scripting

I need suggestion on problem read a file line by line and do stuff

At first, give my best wish for all MOD and admins here. I"m learning bash shell program just for a month, not too much, not too little, but i must admire that i'm very bad at math and algorithm. :( I want to do this : Read the content of a file line by line and at each line, ask me want to... (3 Replies)
Discussion started by: madi3d8
3 Replies

3. Shell Programming and Scripting

problem with KSH script: command line args

Hi I am executing a KSH script by passing command line arguments example: Red Green Dark Red Blue when I am splitting the arguments by using " "(Space) as delimiter But the colour Dark Red is a single parameter. But it is getting splitted in between How to avoid this. Please help Also... (4 Replies)
Discussion started by: hemanth424
4 Replies

4. Shell Programming and Scripting

[Solved] Problem in reading a file line by line till it reaches a white line

So, I want to read line-by-line a text file with unknown number of files.... So: a=1 b=1 while ; do b=`sed -n '$ap' test` a=`expr $a + 1` $here do something with b etc done the problem is that sed does not seem to recognise the $a, even when trying sed -n ' $a p' So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies

5. UNIX for Dummies Questions & Answers

Problem with command line parameters

hi, This is actually realted to a Abinitio command in a unix script. my code is #!/bin/ksh GRAPH_NAME=$1 shift air sandbox run $GRAPH_NAME $* > file.lst 2>&1 if ]; then echo "Pass" fi when i run this script with this command "script.ksh graph_name parameters" the script... (1 Reply)
Discussion started by: siva1612
1 Replies

6. Shell Programming and Scripting

Delete line with match and previous line quoting/escaping problem

Hi folks, I've list of LDAP records in this format: cat cmmac.export.tmp2 dn: deviceId=0a92746a54tbmd34b05758900131136a506,ou=devices,ou=customer,ou=nl,o=upc cmmac: 00:13:11:36:a5:06 dn: deviceId=0a92746a62pbms4662299650015961cfa23,ou=devices,ou=customer,ou=nl,o=upc cmmac:... (4 Replies)
Discussion started by: tomas.polak
4 Replies

7. Shell Programming and Scripting

sed command to replace a line at a specific line number with some other line

my requirement is, consider a file output cat output blah sdjfhjkd jsdfhjksdh sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf hellow there this doesnt look good et cetc etc etcetera i want to replace a line of line number 4 ("this doesnt look good") with some other line ... (3 Replies)
Discussion started by: vivek d r
3 Replies

8. Red Hat

Problem in access the internet through command line

Hi Folks, I have installed Centos-6.4 in my VMware. I have enabled the proxy settings in the network and I am able to access the internet through GUI, but unable to browse via the command line. I did the below options as: 1) Added the proxy setting in /etc/environment file.export... (4 Replies)
Discussion started by: gsiva
4 Replies

9. Shell Programming and Scripting

Perl command line option '-n','-p' and multiple files: can it know a file name of a printed line?

I am looking for help in processing of those options: '-n' or '-p' I understand what they do and how to use them. But, I would like to use them with more than one file (and without any shell-loop; loading the 'perl' once.) I did try it and -n works on 2 files. Question is: - is it possible to... (6 Replies)
Discussion started by: alex_5161
6 Replies

10. Linux

Problem with SFTP Command line, "@" in username.

Hi Guys Any help is appreciated very much! I'm trying to use SFTP to an external server using the native SFTP Client in RHEL 6 and 7. I've been given a username on the remote SFTP Server of myemail@myorg.com. I can not seem to escape that @ sign no matter what I do. I've tried these... (16 Replies)
Discussion started by: BG_JrAdmin
16 Replies
doctools::tcl::parse(n) 					Documentation tools					   doctools::tcl::parse(n)

__________________________________________________________________________________________________________________________________________________

NAME
doctools::tcl::parse - Processing text in 'subst -novariables' format SYNOPSIS
package require Tcl 8.4 package require snit package require fileutil package require logger package require struct::list package require struct::stack package require struct::set package require treeql ::doctools::tcl::parse text tree text ?root? ::doctools::tcl::parse file tree path ?root? _________________________________________________________________ DESCRIPTION
This package provides commands for parsing text with embedded Tcl commands as accepted by the Tcl builtin command subst -novariables. The result of the parsing is an abstract syntax tree. This is an internal package of doctools, for use by the higher level parsers processing the docidx, doctoc, and doctools markup languages. API
::doctools::tcl::parse text tree text ?root? The command takes the text and parses it under the assumption that it contains a string acceptable to the Tcl builtin command subst -novariables. Errors are thrown otherwise during the parsing. The format used for these errors in described in section Error format. The command returns the empty string as it result. The actual result of the parsing is entered into the tree structure tree, under the node root. If root is not specified the root of tree is used. The tree has to exist and be the command of a tree object which supports the same methods as trees created by the package struct::tree. In case of errors tree will be left in an undefined state. ::doctools::tcl::parse file tree path ?root? The same as text, except that the text to parse is read from the file specified by path. ERROR FORMAT
When the parser encounters a problem in the input it will throw an error using the format described here. [1] The message will contain the reason for the problem (unexpected character or end of input in input), the character in question, if any, and the line and column the problem was found at, in a human readable form. This part is not documented further as its format may change as we see fit. It is intended for human consumption, not machine. [2] The error code however will contain a machine-readable representation of the problem, in the form of a 5-element list containing, in the order listed below [1] the constant string doctools::tcl::parse [2] the cause of the problem, one of char Unexpected character in input eof Unexpected end of the input [3] The location of the problem as offset from the beginning of the input, counted in characters. Note: Line markers count as one character. [4] The line the problem was found on (counted from 1 (one)), [5] The column the problem was found at (counted from 0 (zero)) TREE STRUCTURE
After successfully parsing a string the generated tree will have the following structure: [1] In the following items the word 'root' refers to the node which was specified as the root of the tree when invoking either text or file. This may be the actual root of the tree. [2] All the following items further ignore the possibility of pre-existing attributes in the pre-existing nodes. If attributes exists with the same names as the attributes used by the parser the pre-existing values are written over. Attributes with names not clash- ing with the parser's attributes are not touched. [3] The root node has no attributes. [4] All other nodes have the attributes type The value is a string from the set { Command , Text , Word } range The value is either empty or a 2-element list containing integer numbers. The numbers are the offsets of the first and last character in the input text, of the token described by the node,. line The value is an integer, it describes the line in the input the token described by the node ends on. Lines are counted from 1 (one). col The value is an integer, it describes the column in the line in the input the token described by the node ends on. Columns are counted from 0 (zero). [5] The children of the root, if any, are of type Command and Text, in semi-alternation. This means: After a Text node a Command node has to follow, and anything can follow a Command node, a Text or other Command node. [6] The children of a Command node, if any, are of type Command, and Text, and Word, they describe the arguments of the command. [7] The children of a Word node, if any, are of type Command, Text, in semi-alternation. This means: After a Text node a Command node has to follow, and anything can follow a Command node, a Text or other Command node. [8] A Word node without children represents the empty string. [9] All Text nodes are leaves of the tree. [10] All leaves of the tree are either Text or Command nodes. Word nodes cannot be leaves. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category doctools of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
Tcl syntax, command, doctools, parser, subst, word CATEGORY
Documentation tools COPYRIGHT
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net> doctools2base 1 doctools::tcl::parse(n)
All times are GMT -4. The time now is 08:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy