Sponsored Content
Full Discussion: problem with read command
Top Forums Shell Programming and Scripting problem with read command Post 302341462 by kshji on Thursday 6th of August 2009 03:42:55 AM
Old 08-06-2009
Code:
cat log.out | sed -n '4,4p'| read value
echo "$value"

Works fine with ksh88 and ksh93. Just tested - echo something, if log.out has more than 3 lines.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SH script problem with read

Hi, I'm doing a script that reads lines from a file and then copy them to another file, if the user wants it. But I'having problems to get the user selection because when I do the read to ask the user, the script reads the next line of the file. The script looks like this: #!/bin/sh # ... (2 Replies)
Discussion started by: pmpx
2 Replies

2. Shell Programming and Scripting

Problem with read in sh

I've discovered a very annoying problem in sh: echo -en "one\ntwo\nthree" | while read VALUE do echo "${VALUE}" done This will print one and two, but not three. The last line is IGNORED because it lacks a newline. This makes it hard to use sh for things like CGI scripting; you have... (6 Replies)
Discussion started by: Corona688
6 Replies

3. Programming

Problem with read & write

Hello mates: I met problem with using read() & write(). I m trying to use read twice on client first time is the size of buffer, 2nd time is the buffer. I think I have to, coz I dnot know file size. So, I write twice on server as well -- 1st, filesize; 2nd, buffer. The problem is, sometimes,... (11 Replies)
Discussion started by: EltonSky
11 Replies

4. Programming

Problem in read() from a pipe

Hi, Can any one please help me with this. Am struggling hard to get a solution. I am doing telnet through a C program and getting the stdout file descriptor of the remote machine to pipe. read() function is getting data, But whenl it receives SOH character ie. ^A ( Start of heading = Console... (2 Replies)
Discussion started by: JDS
2 Replies

5. Shell Programming and Scripting

While Read problem

Hello, I have this simple script while read name do ssh $name "hostname > /tmp/$name.txt" ssh $name "/opt/ignite/bin/print_manifest | grep Main >> /tmp/$name.txt" ssh $name "getconf MACHINE_SERIAL >> /tmp/$name.txt" ssh $name "ioscan -kfnC processor | grep processor | wc -l >>... (3 Replies)
Discussion started by: Andyp2704
3 Replies

6. Shell Programming and Scripting

Problem to read archive

Dear all, I have this archive: cat file.txt archive test 02 sequence 03 02length 52 archive test 02 sequence 04 02length 52 archive test 02 sequence 05 02length 52 teste arquivo 06 sequencia 08 06 length 54 teste arquivo 06 sequencia 09 ... (8 Replies)
Discussion started by: cewa67
8 Replies

7. UNIX for Dummies Questions & Answers

read command - using output from command substitution

Hey, guys! Trying to research this is such a pain since the read command itself is a common word. Try searching "unix OR linux read command examples" or using the command substitution keyword. :eek: So, I wanted to use a command statement similar to the following. This is kinda taken... (2 Replies)
Discussion started by: ProGrammar
2 Replies

8. Shell Programming and Scripting

Problem with read line

Hi everybody, I am new to shell script. Please help me with this problem. I have a file test.txt with the content like this: I have a shell script test.sh like this #!/bin/sh while read line do echo $line >> out.txt done < test.txt out.txt is expected to have the same content... (10 Replies)
Discussion started by: Dark2Bright
10 Replies

9. Shell Programming and Scripting

Read from file and execute the read command

Hi, I am facing issues with the below: I have a lookup file say lookup.lkp.This lookup.lkp file contains strings delimited by comma(,). Now i want to read this command from file and execute it. So my code below is : Contents in the lookup.lkp file is : c_e,m,a,`cd $BOX | ls cef_*|tail... (7 Replies)
Discussion started by: vital_parsley
7 Replies

10. UNIX for Beginners Questions & Answers

Read -p problem

Hi, :) I tried to make of "line returns" with "\n" : read -p $'Do you really want append this line in '$CONFIG_FILE''\n'IP CLIENT: '$IP_INPUT' - PATH: '$PATH_INPUT''\n'y/n ?:' CONFIRM_INPUT But it didn't work, please anyone have an idea? :b: (2 Replies)
Discussion started by: Arnaudh78
2 Replies
XSLT_SET_LOG(3) 							 1							   XSLT_SET_LOG(3)

xslt_set_log - Set the log file to write log messages to

SYNOPSIS
void xslt_set_log (resource $xh, [mixed $log]) DESCRIPTION
This function allows you to set the file in which you want XSLT log messages to, XSLT log messages are different than error messages, in that log messages are not actually error messages but rather messages related to the state of the XSLT processor. They are useful for debugging XSLT, when something goes wrong. By default logging is disabled, in order to enable logging you must first call xslt_set_log(3) with a boolean parameter which enables log- ging, then if you want to set the log file to debug to, you must then pass it a string containing the filename. PARAMETERS
o $ xh -The XSLT processor link identifier, created with xslt_create(3). o $log - This parameter is either a boolean value which toggles logging on and off, or a string containing the logfile in which log errors too. RETURN VALUES
No value is returned. NOTES
Note Please note that file:// is needed in front of the path when using Windows. EXAMPLES
Example #1 Using the XSLT Logging features <?php $xh = xslt_create(); xslt_set_log($xh, true); xslt_set_log($xh, getcwd() . '/myfile.log'); $result = xslt_process($xh, 'dog.xml', 'pets.xsl'); echo $result; xslt_free($xh); ?> PHP Documentation Group XSLT_SET_LOG(3)
All times are GMT -4. The time now is 05:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy