Sponsored Content
Top Forums UNIX for Dummies Questions & Answers sed Or Grep Problem OR Terminal Problem? Post 302934939 by disedorgue on Thursday 12th of February 2015 04:11:39 AM
Old 02-12-2015
Hi,
If you have names of file with quote, you can to have this problem, example:
Code:
$ touch "XX'YY"
$ ls -l
total 0
-rw-r--r-- 1 XXXXXXXX Domain Users 0 12 févr. 10:06 XX'YY
$ for i in *; do echo $i :done
> ^C
$ for i in *; do echo "$i" :done
>

Sorry, my assertion is false, because my example contains an error:
:done between ;done
And without this error, loop for work fine Smilie

Regards.

Last edited by disedorgue; 02-12-2015 at 06:06 AM.. Reason: possible response wrong because i test ":done" between ";done"
This User Gave Thanks to disedorgue For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

terminal problem

Hi all While trying to upon a new window it is saying UNABLE TO GET PTY..what does this means how to solve it Thanks Prafulla (4 Replies)
Discussion started by: Prafulla
4 Replies

2. UNIX for Advanced & Expert Users

terminal type problem with cygwin on aix

hey, I use cygwin to connect to AIX 5.2 but when I open vi I get an error saying: ex: 0602-108 cygwin is not a recognized terminal type how can I fix that? I thought cygwin was tty vt100? (1 Reply)
Discussion started by: rein
1 Replies

3. SCO

Terminal Allocation Problem

Hello All, I am facing a problem on SCO Open Server V 5x, We are using serial communication on dumb terminals, right now i am facing a problem on some terminals, as they are not showing thier previous tty no, as tty13 or tty18, but they are showing ttya6 or ttya4, i also tried to move and link... (5 Replies)
Discussion started by: Awadhesh
5 Replies

4. Programming

terminal problem

i am executiing some commands using system an popen command in c. while executing the code . some data is shown on terimal without using any print statement. how can i solve this problem thank u sree (1 Reply)
Discussion started by: phani_sree
1 Replies

5. Linux

tty terminal permissions problem

I'm hoping someone can help me out here. I'm having a problem on my Red Hat Enterprise 5 Server where my tty devices "tty" are being set to read only permissions. I need them to be set to 777 in order to write to the serial printers through a custome application. I have gone through many... (2 Replies)
Discussion started by: Netwrkengeer
2 Replies

6. Shell Programming and Scripting

Problem with gnome-terminal

Hello everyone. This is my first post.:o Using Ubuntu 8.04 and bash 3.2.39 i'm trying to adapt my routine to this platform. So, this means forget xterm and use gnome-terminal (as default ubuntu terminal). EveryDay i need to connect to several servers, and i've made a Tcl'script to make this... (1 Reply)
Discussion started by: trutoman
1 Replies

7. Shell Programming and Scripting

Problem - gnome terminal shell scripting

I've a python script named rwe.py. I'm running the program in three separate terminals. If one of the executing program stops . I want to leave the terminal as it is so that i can see the error. i wrote a the below script and used cron to run it every one hour to check if the three programs are... (0 Replies)
Discussion started by: msteve2002
0 Replies

8. Linux

Terminal logging character problem -Newbie-

Im a complete newbie tryin to work with linux centos; in terminal wanted to log with script command; but output file has some strange characters when I try to open with gedit or bluefish terminal , gedit, bluefish encoding is utf-8 ; Script started on Mon 08 Mar 2010 03:32:39 PM EET... (2 Replies)
Discussion started by: anacondauser
2 Replies

9. HP-UX

Problem with terminal

Hi Guys, I'm using my putty to connect to the HP-UX test box. Once I get connected to server there seem to be something wrong with my putty that behaves very odd. for example it starts from the half of the screen. I really dont know how to explain this problem. or for instance when i run vi to... (2 Replies)
Discussion started by: messi777
2 Replies

10. UNIX for Dummies Questions & Answers

Silly problem with sed and grep

I am trying to delete all empty lines from a file using either grep -v ^$ file or sed '/^$/d' file But neither one is working. I have uploaded the file I am trying to modify. Any help will be greatly apreciated. (3 Replies)
Discussion started by: Xterra
3 Replies
ASSERT(3)								 1								 ASSERT(3)

assert - Checks if assertion is FALSE

SYNOPSIS
bool assert (mixed $assertion, [string $description]) DESCRIPTION
assert(3) will check the given $assertion and take appropriate action if its result is FALSE. If the $assertion is given as a string it will be evaluated as PHP code by assert(3). The advantages of a string $assertion are less over- head when assertion checking is off and messages containing the $assertion expression when an assertion fails. This means that if you pass a boolean condition as $assertion this condition will not show up as parameter to the assertion function which you may have defined with the assert_options(3) function, the condition is converted to a string before calling that handler function, and the boolean FALSE is con- verted as the empty string. Assertions should be used as a debugging feature only. You may use them for sanity-checks that test for conditions that should always be TRUE and that indicate some programming errors if not or to check for the presence of certain features like extension functions or certain system limits and features. Assertions should not be used for normal runtime operations like input parameter checks. As a rule of thumb your code should always be able to work correctly if assertion checking is not activated. The behavior of assert(3) may be configured by assert_options(3) or by .ini-settings described in that functions manual page. The assert_options(3) function and/or ASSERT_CALLBACK configuration directive allow a callback function to be set to handle failed asser- tions. assert(3) callbacks are particularly useful for building automated test suites because they allow you to easily capture the code passed to the assertion, along with information on where the assertion was made. While this information can be captured via other methods, using assertions makes it much faster and easier! The callback function should accept three arguments. The first argument will contain the file the assertion failed in. The second argument will contain the line the assertion failed on and the third argument will contain the expression that failed (if any -- literal values such as 1 or "two" will not be passed via this argument). Users of PHP 5.4.8 and later may also provide a fourth optional argument, which will contain the $description given to assert(3), if it was set. PARAMETERS
o $assertion - The assertion. o $description - An optional description that will be included in the failure message if the $assertion fails. RETURN VALUES
FALSE if the assertion is false, TRUE otherwise. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.4.8 | | | | | | | The $description parameter was added. The | | | $description is also now provided to a callback | | | function in ASSERT_CALLBACK mode as the fourth | | | argument. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 Handle a failed assertion with a custom handler <?php // Active assert and make it quiet assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_WARNING, 0); assert_options(ASSERT_QUIET_EVAL, 1); // Create a handler function function my_assert_handler($file, $line, $code) { echo "<hr>Assertion Failed: File '$file'<br /> Line '$line'<br /> Code '$code'<br /><hr />"; } // Set up the callback assert_options(ASSERT_CALLBACK, 'my_assert_handler'); // Make an assertion that should fail assert('mysql_query("")'); ?> Example #2 Using a custom handler to print a description <?php // Active assert and make it quiet assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_WARNING, 0); assert_options(ASSERT_QUIET_EVAL, 1); // Create a handler function function my_assert_handler($file, $line, $code, $desc = null) { echo "Assertion failed at $file:$line: $code"; if ($desc) { echo ": $desc"; } echo " "; } // Set up the callback assert_options(ASSERT_CALLBACK, 'my_assert_handler'); // Make an assertion that should fail assert('2 < 1'); assert('2 < 1', 'Two is less than one'); ?> The above example will output: Assertion failed at test.php:21: 2 < 1 Assertion failed at test.php:22: 2 < 1: Two is less than one SEE ALSO
assert_options(3). PHP Documentation Group ASSERT(3)
All times are GMT -4. The time now is 08:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy