Sponsored Content
Top Forums Shell Programming and Scripting 1 Command - 2 Behaviours and a wrong false message Post 302931063 by sea on Friday 9th of January 2015 10:35:43 PM
Old 01-09-2015
1 Command - 2 Behaviours and a wrong false message

Heyas

As there was a splitting issue with TUI 0.6.6-x focused around tui-status since the 'solaris' (not really but for that purpose) update, the urge was given to do this first.

Well, the splitting 'bug' should be fixed, i hope.
But i've found a new one.

When i start the very same script in two diffrent ways, it one time works, the other time it dont.

One script is called by the WM named 'Awesome':
LUA (rc.lua):
Code:
...
	terminal = "lxterminal"
	term_cmd = terminal .. " -e "
...
	 { "BG: NASA iotd", term_cmd .. awful.util.getdir("config") .. "/scripts/nasaBackground-new2.sh",  },

And the other time i call it like:
Code:
./scripts/nasaBackground-new2.sh

So basicly, i call it two times the same way.
Right?

During this test phase, i check if the first argument is numeric, by this (bash):
Code:
		check=$(echo "$1" | tr -d [:digit:])
		if [[ -z "$check" ]] && [[ ! -z "$1" ]] 		# && echo $1 | grep -q [0-9]
		then	echo "all numbers:: $1" > /dev/zero
		else	echo "First argument $1 ($check) is not numeric!"
			exit 1
		fi

But see this (wide!):
https://sea.fedorapeople.org/review/...rs_4_small.jpg
I also checked wether there was a leading or tailing space, by changing to ~ "first argument .$1. is not numeric", there is not.

While writing the post, i've added the ($check) is not numeric, and reran the script, for some reason i dont understand or see in the code, it seems than when the script is started by 'lua' - the interface, the values are bogus: "$check" = "$1"

Any idea why?
- or how i could fix this please?

Thank you in advance.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Whats wrong with the mv command

I am sorry guys I have figured out the error myself. (0 Replies)
Discussion started by: dsravan
0 Replies

2. Shell Programming and Scripting

Is anything wrong with this command

Hi All, can anyone tell me what is wrong with this command. tail -f /opt/olr-logs/PaymentGateway.log | grep "DEBUG - Start! AkhtarPaymentGateway - generateChecksum" | awk '{print $13}' | sed 's/,//g'>> abc But I found nothing in the file abc Please do help me.or Provide me some... (8 Replies)
Discussion started by: akhtar.bhat
8 Replies

3. UNIX for Advanced & Expert Users

what is wrong with this find command

i am trying to find the files which are more than 100MB and it was created 10 days ago. find /lola/loaded -size +102400 -mtime -10 -print | xargs ls -ltr -rw-rw-r-- 1 lola_adm gdrmp 82054170 Jun 23 06:17 /lola/loaded/ILMEMBER20090622.txt -rw-rw-r-- 1 lola_adm gdrmp 652080494 Jun 24... (3 Replies)
Discussion started by: sudhiroracle
3 Replies

4. UNIX for Dummies Questions & Answers

what is wrong with this command?

Hello, I try to using the below command to find out all the datafiles under "sja" direcotory. $ xargs -i find {} -type f -ls < sja /bin/ksh: sja: cannot open so can you tell me what is wrong? Thanks Jerry (3 Replies)
Discussion started by: GreatJerry
3 Replies

5. Shell Programming and Scripting

What's wrong with the following command?

Hi all, I'm trying to run the following command to get all files in one directory to another with the files' timestamps preserved, cp -p /logs/dvgbiau/batch/* /logs/dvgbiau/tmp_batch Note that ./batch and ./tmp_batch are two sub-directories under /logs/dvgbiau. The error was,... (1 Reply)
Discussion started by: isaacniu
1 Replies

6. Solaris

After command setenv auto-boot false machine's console not displaying

hi Alll, I want to install solaris 10 on exixting solaris mahcine. I tried for OK boot cdrom-install but it gave me fatal error - disk not bootable , boot command disable so i tried with ok setenv auto-boot? false Ok reset-all after this server rebooted automatically and... (2 Replies)
Discussion started by: sunray
2 Replies

7. Solaris

User account get locked due to strange behaviours

I am facing strange problem where after three failed login attempt user password must be locked. Actually what is happening, when I take the putty session of the server & enter user name on the prompt at the login prompt & then press enter to enter the password at this time when I checked the... (10 Replies)
Discussion started by: sb200
10 Replies

8. Shell Programming and Scripting

What is wrong with my awk command?

The below code usually works when the value for the COLUMN variable is numerical. but im in a situation where the number of fields in a file is not definitive. it changes. but what is static is that the value i want to retrieve from the log is 3 fields from the last field. which is what i... (9 Replies)
Discussion started by: SkySmart
9 Replies
Locale::Codes::Script(3pm)				 Perl Programmers Reference Guide				Locale::Codes::Script(3pm)

NAME
Locale::Codes::Script - standard codes for script identification SYNOPSIS
use Locale::Codes::Script; $script = code2script('phnx'); # 'Phoenician' $code = script2code('Phoenician'); # 'Phnx' $code = script2code('Phoenician', LOCALE_CODE_NUMERIC); # 115 @codes = all_script_codes(); @scripts = all_script_names(); DESCRIPTION
The "Locale::Codes::Script" module provides access to standards codes used for identifying scripts, such as those defined in ISO 15924. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 15924 four-letter codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying scripts. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $script = code2script('phnx','alpha'); $script = code2script('phnx',LOCALE_SCRIPT_ALPHA); The codesets currently supported are: alpha, LOCALE_SCRIPT_ALPHA This is a set of four-letter (capitalized) codes from ISO 15924 such as 'Phnx' for Phoenician. It also includes additions to this set included in the IANA language registry. The Zxxx, Zyyy, and Zzzz codes are not used. This is the default code set. num, LOCALE_SCRIPT_NUMERIC This is a set of three-digit numeric codes from ISO 15924 such as 115 for Phoenician. ROUTINES
code2script ( CODE [,CODESET] ) script2code ( NAME [,CODESET] ) script_code2code ( CODE ,CODESET ,CODESET2 ) all_script_codes ( [CODESET] ) all_script_names ( [CODESET] ) Locale::Codes::Script::rename_script ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::Script::add_script ( CODE ,NAME [,CODESET] ) Locale::Codes::Script::delete_script ( CODE [,CODESET] ) Locale::Codes::Script::add_script_alias ( NAME ,NEW_NAME ) Locale::Codes::Script::delete_script_alias ( NAME ) Locale::Codes::Script::rename_script_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::Script::add_script_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::Script::delete_script_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.unicode.org/iso15924/ Home page for ISO 15924. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). Copyright (c) 2001-2010 Neil Bowers Copyright (c) 2010-2012 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 Locale::Codes::Script(3pm)
All times are GMT -4. The time now is 12:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy