I apologize if this treads already covered ground (which I sure it must have), however I wasn't able to determine what I needed from searches.
I'm trying to do detemine if a string represents a file name or not (i.e., is in the form "string.ext" or just "string"), by seeing if there's a period in the string.
I've created the string by parsing a list of paths. Some are paths to folders, some directly to files (this is a list of things to zip up into an archive). Like so:
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.
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)
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)
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)
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)
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)
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)
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)
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)
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)