Thanks for that solution - that at least either gives me the result or an empty string. Now I need to do a search to figure out how to test the variable for a null value...
---------- Post updated at 04:10 PM ---------- Previous update was at 03:58 PM ----------
O.k, a combo of yazu's solution and a null string check does the job:
----- /Volumes/projects/_library/assets/textures/SeaLife/seaweed/seaweed01_base_v2.jpg Variables -----
slash count is :10
last part is :seaweed01_base_v2.jpg
seaweed01_base_v2.jpg has a period in it.
----- /Volumes/projects/_library/assets/digital-doubles/dd_sean/txt/DD_sean_splint_color.exr Variables -----
slash count is :10
last part is D_sean_splint_color.exr
DD_sean_splint_color.exr has a period in it.
----- /Volumes/projects/es/0697/3d/cam/_PUBLISH Variables -----
slash count is :9
last part is :_PUBLISH
_PUBLISH does not have a period in it.
Hi,
in my korn shell I have this code:
typeset -uL1 rc
read rc?"Insert Y=Yes (default) or N=No >>"
If I press enter without value I wish to set rc=Y. This is my default.
This test: if ] then .... Do not work.
I hope in your help. Thanks in advance.
Regards,
Giovanni (3 Replies)
Hi
] && exit 0
Although it, the $answer, is 'y', the test operation returns true.
&& exit 0
This works but I want to do multiple choice matching.
I don't want to do like:
Please help (2 Replies)
Hello,
I wanted to display command with echo like this in tcsh.
output should be "//'test.test1.test2'"
(" at both ends also required in output)
Please help me. (1 Reply)
If I have a string defined as:
MyString=abcde
echo $MyString
How can I loop through it character by character? I haven't been able to find a way to index the string so that I loop through it.
shew01 (10 Replies)
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
I want to compare two values for Value A and ValueB, however, they are strings, so is there a way I could them into numberical value in tcsh
#! /bin/tcsh
set ValueA = `awk '{print $6}' out0File`
set ValueB = `awk '{print $6}' out1File`
set Delta = `expr $ValueA - $ValueB`
... (1 Reply)
Hi all,
Case 1 :
A=88^M
&& echo "PASS"
Result:
PASS
Case 2:
A=88
&& echo "PASS"
Result:
PASS
I would like to know why Case 1 and Case 2 got the same result? What make ^M ignored ?
Thanks in advance. (6 Replies)
Hi,
Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank.
Text file :
"1"|"ExternalClassDEA519CF5"|"Art1"
"2"|"ExternalClass563EA516C"|"Art3"
"3"|"ExternalClass305ED16B8"|"Art9"
...
...
... (2 Replies)
Hallo,
I try to write a tcsh-script which works with ImageMagick.
The following command line works perfectly:
convert a.tif -pointsize 80 -draw " gravity NorthWest fill black text 0,12 a " b.tif
I use the following code in a script (it is a minimal example to show the problem):
... (3 Replies)
Discussion started by: DanielDD
3 Replies
LEARN ABOUT REDHAT
zgrep
ZGREP(1) General Commands Manual ZGREP(1)NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep is used to invoke the grep on compress'ed or gzip'ed files. All options specified are passed directly to grep. If no file is speci-
fied, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and
fed to grep.
If zgrep is invoked as zegrep or zfgrep then egrep or fgrep is used instead of grep. If the GREP environment variable is set, zgrep uses
it as the grep program to be invoked. For example:
for sh: GREP=fgrep zgrep string files
for csh: (setenv GREP fgrep; zgrep string files)
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), egrep(1), fgrep(1), zdiff(1), zmore(1), znew(1), zforce(1), gzip(1), gzexe(1)ZGREP(1)