Sponsored Content
Full Discussion: Ksh script: std Out/err
Top Forums Shell Programming and Scripting Ksh script: std Out/err Post 302494440 by fpmurphy on Monday 7th of February 2011 10:28:04 AM
Old 02-07-2011
Your code can be simplified as shown by the following simple example:
Code:
MyFile='CR_CHR_GSM_*.data.gz'

if [[ $(ls -l $MyFile 2>/dev/null | wc -l | tr -d ' ') > 0 ]]
then
   echo "true"
else
   echo "false"
fi

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to redirect std out and std err to same file

Hi I want both standard output and standard error of my command cmd to go to the same file log.txt. please let me know the best commandline to do this. Thanks (2 Replies)
Discussion started by: 0ktalmagik
2 Replies

2. Shell Programming and Scripting

How to redirect std err and out to log file for multi-commands?

The following command does not work under cygwin bash. ant debug >log 2>&1 && ant image >>log 2>>&1 & pid=$! It gives the error "-bash: sysntax error near unexpected token '&'". Is there a way I can redirect std output and std error to file "log" for both the commands "ant debug" and "ant... (1 Reply)
Discussion started by: siegfried
1 Replies

3. Programming

Sun Studio C++ - Getting error in linking std::ostream &std::ostream::operator<<(std:

Hello all Im using CC: Sun C++ 5.6 2004/07/15 and using the -library=stlport4 when linkning im getting The fallowing error : Undefined first referenced symbol in file std::ostream &std::ostream::operator<<(std::ios_base&(*)(std::ios_base&))... (0 Replies)
Discussion started by: umen
0 Replies

4. Shell Programming and Scripting

read from std i/p with timeout within a script

hello every one , this is my first participation in the forum , I hope it'll be a good start within a script I would like to put some code to read i\p from standard i\p using read command if it reads Y it will terminate the script if it reads N it will continue execution , if no i\p is... (2 Replies)
Discussion started by: Blue_shadow
2 Replies

5. UNIX for Advanced & Expert Users

truss: script runs without, but 'sysntax err' with it ?!

When I run a script with truss it is exiting with error. Without truss the script runs fine! How to understand it? I have used the truss to resolve a 'magic' disappearing, but it brings own questions. The main problem is in a backgroun script, which on one server just disapeares,... (5 Replies)
Discussion started by: alex_5161
5 Replies

6. Shell Programming and Scripting

password file as std input to script

I'm a fairly new AIX admin (disclaimer). We have SQL scripts written by end users that use a userid and passwd to connect to our DB2 database. Is it possible to create an "input file" that contains the db2 connect parameters and yet secure the file from the SQL creator? i.e., they can "use"... (2 Replies)
Discussion started by: mpheine
2 Replies

7. Shell Programming and Scripting

Script to monitor for new file with ext .err and size > 0 bytes and perform a action or command

Hi All, I need to create a script to monitor a dir for new files with ext .err and also it should b a non empty files. and perform a action or command . We have a new ETL application that runs on a linux server, every times a etl fails it creates a .err file or updates the existing .err... (4 Replies)
Discussion started by: MAKHAN
4 Replies

8. Shell Programming and Scripting

ksh view std err state

I would like to know if a command works. "command" 2>/dev/null When I issue the command, the error is suppressed. How can I tell whether there was an error? (3 Replies)
Discussion started by: robin_simple
3 Replies

9. Shell Programming and Scripting

Keeping std & err outputs alive and feed one log file in a one-shot way

Bonjour, I have a large script with a lot of print statements and misc commands. Standard and error outputs are redirected like into the following code : #!/usr/bin/ksh LOG=/<some dir>/log > $LOG exec >>${LOG} 2>>${LOG} print aaaaa print bbbbb print ccccc ... some_cmd That way,... (5 Replies)
Discussion started by: Fundix
5 Replies
LOCALE_FILTER_MATCHES(3)						 1						  LOCALE_FILTER_MATCHES(3)

Locale::filterMatches - Checks if a language tag filter matches with locale

	Object oriented style

SYNOPSIS
publicstatic bool Locale::filterMatches (string $langtag, string $locale, [bool $canonicalize = false]) DESCRIPTION
Procedural style bool locale_filter_matches (string $langtag, string $locale, [bool $canonicalize = false]) Checks if a $langtag filter matches with $locale according to RFC 4647's basic filtering algorithm PARAMETERS
o $langtag - The language tag to check o $locale - The language range to check against o $canonicalize - If true, the arguments will be converted to canonical form before matching. RETURN VALUES
TRUE if $locale matches $langtag FALSE otherwise. EXAMPLES
Example #1 locale_filter_matches(3) example <?php echo (locale_filter_matches('de-DEVA','de-DE', false)) ? "Matches" : "Does not match"; echo '; '; echo (locale_filter_matches('de-DE_1996','de-DE', false)) ? "Matches" : "Does not match"; ?> Example #2 OO example <?php echo (Locale::filterMatches('de-DEVA','de-DE', false)) ? "Matches" : "Does not match"; echo '; '; echo (Locale::filterMatches('de-DE-1996','de-DE', false)) ? "Matches" : "Does not match"; ?> The above example will output: Does not match; Matches SEE ALSO
locale_lookup(3). PHP Documentation Group LOCALE_FILTER_MATCHES(3)
All times are GMT -4. The time now is 06:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy