I now see that getline returns a value, which may be why it doesn't throw an exception on all systems -- it can't do both at the same time, the implementor had to pick one in the event of failure. As for why EOF doesn't occur after a failed getline, I can only guess how Sun implemented their iostream. It certainly looks like it ought to produce EOF under those circumstances. So I guess you'll just need to check all return values for errors to be compatible with both. Which is probably a good idea anyway...
so your usual while loop, and with the getline, you do this:
which will cause the loop to break when getline fails as well as checking for exceptions.
Last edited by Corona688; 11-17-2008 at 11:33 AM..
Hi,
I'd like to access a windows directory from aix with samba client.
To allow direct access (not interactive), i'm using EOF like:
smbclient \\\\winserver\\windir 'passwd' -U usersmb << EOF
cd subwindir
put myfile
EOF
The access is correct but does somebody know how to trap errors... (1 Reply)
Hello, you are an awesome crowd! You answered my last questions, thank you sooo much!
I am trying to write a korn shell script that will record the memory my application is using (HP-UX B.11.11) and I have this:
if (( $APP > $THRESHOLD ))
then
echo "Warning message will display"
cat... (2 Replies)
I have written this code:
code
echo 'Now choose the file or files you want to merge your input with: \c'
read filenames
filelist=""
for file in $filenames; do
filelist="$filelist $file"
done
echo "Now that you've chosen these files ($filelist), please start typing: "
until ; do
paste -... (2 Replies)
hi,
in a shell script i came accross the following bit of code
1.shift $(($OPTIND - 1))
2.if ; then
3. cat << EOF >&2
4.Usage: $0 lockfilename
5.EOF
6. exit 1
7.fi
I am not able to understand the meaning of lines(1,3,5).
Can any one of u tell me the purpose of above said lines.... (1 Reply)
hello all
im trying to use in sun Solaris the information received from the top command
now i several machines that dont have install the top program so when im running the script im geting error
saying after im running this code :
set MemoryInfo = `top | grep Memory`
if (... (2 Replies)
Hello all,
I have unix file that ends with the following EOF '9999999999'
I want to remove the '\n' character after EOF. What is the command that should be included in the script, before sending the file?
will this work:
$ echo "<99999999999>\c" >> <filename>
thanks in advance. (3 Replies)
I'm trying to connect to oracle with the following code in the script:
checksqlerror{
if
echo $1
exit
fi
}
$SQLPLUS username/password@schemaname
checksqlerror "failed to connect to oracle"
If I'm passing wrong schema name,instead of executing checksqlerror it stops and expects user... (2 Replies)
Hey!
Can I write a routine that allows me to in a txt file check line by line until the end of file?
something like
until do
---some code---
done
maybe it is a stupid question but I never learned shell scripts and I need this :p
thanks in advance (1 Reply)
Hi friends ,
I am confused with << EOF
EOF
Most of the cases I found
sqlplus $db_conn_str << EOF
some sql staments
EOF
another exapmle is
#!/bin/sh
echo -n 'what is the value? '
read value
sed 's/XXX/'$value'/' <<EOF
The value is XXX
EOF (1 Reply)
Discussion started by: imipsita.rath
1 Replies
LEARN ABOUT DEBIAN
beef
BEEF(1) User Commands BEEF(1)NAME
beef - flexible Brainfuck interpreter
SYNOPSIS
beef [OPTIONS] FILE
DESCRIPTION
beef is a Brainfuck interpreter written in C. It is written with flexibility and portability in mind: it is not the smallest nor the
fastest Brainfuck interpreter on Earth, but it has some options to control his behavior and doesn't suffer most of the limitations which
are usually present in Brainfuck interpreters.
One of the best features of beef is that it has no limitations on the length of the tape, which is created dinamically, and allows you to
move in any direction, even to move an unlimited amount of cells left when you are on the starting cell.
beef also allows you to control his behavior in case it reads and EOF from the input stream: see below for a list of available options.
OPTIONS -d Enable debugging. The debugging command # is not part of the Brainfuck language, but it's an useful feature for the programmer, so
most interpreters implement it. Debugging is off by default.
-e When read an EOF from input, store an EOF in the current cell. This is for compatibility with programs written for other inter-
preters; the default behavior is to store a 0 in the current cell when an EOF is read.
-n When read an EOF from input, do nothing. This is the default behavior in some other interpreters, so it's supported in beef for com-
patibility reasons. The default behavior is to store a 0 on the current cell instead.
--version
Show the version number and exit successfully.
--help Show a short help message and exit with success.
EXIT STATUS
beef returns an exit staus of zero on success, or an exit status of -1 if it was unable to perform the requested operation.
Please note that no checks are performed on the code: if the code you are trying to run is buggy, beef will run it anyway and the result
will probably differ from what you expected.
AUTHOR
This manual page was written by KiyuKo <eof AT kiyuko DOT org>
0.0.6 February 01, 2007 BEEF(1)