10-31-2005
Unwanted Error Message on Screen
Below is a part of the script that I wrote when checking whether a file exist in the Internal Disk or not. If a file doesn't exist, how do you get rid of the error message "file or directory does not exist" to show up on screen? Instead, I wanted only the warning message "FILE DOES NOT EXIST IN INTERNAL DISK" that I have setup to appear? Please help me out. Thanks a lot!
#! /bin/csh -f
# fn = filename.
set fn = `cat fn`
#cfn = check filename if it exist in Internal disk.
set cfn = y
while ($cfn == y)
printf "\n\n\n\nEnter filename, `echo $fn` (default) or x (exit): "
set fn = $<
if ($fn == x) then
else
if ( $fn == "" ) then
set fn = `cat fn`
else
echo $fn > fn
endif
ls $SOLHOME/internalDisk/"$fn" | wc -l > cfn
clear
set cfn = `cat cfn`
if ( $cfn == 0 ) then
printf "\n\n\n\n%8s==================================================\n\n"
printf " "\""FILE "\"""$fn""\"" DOES NOT EXIST IN THE INTERNAL DISK\!"\"""
printf "\n\n%8s==================================================\n"
set cfn = y
#end1
end
else
endif
endif
5 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi guys,
I have a script that call another, the other displays de message and I can print directly to the flat file, but in one command I am searchig that this message can be displayed in the screen and in the flat file in one command.
I am doing something like this:
var=$(./Example.sh)... (2 Replies)
Discussion started by: pipoca
2 Replies
2. AIX
Hello,
I keep getting this message even after i removed it from the cron enteries it was added automatically
Broadcast message from root@oradb (tty) at 12:00:00 ...
rc.powerfail:2::WARNING!!! The system is now operating with a power problem. This message will be walled every 12... (2 Replies)
Discussion started by: filosophizer
2 Replies
3. Red Hat
Hi,
I have a simple question : how to disable screen lock and/or sreen saver with command line with RHEL5.4 ? (1 Reply)
Discussion started by: albator1932
1 Replies
4. Shell Programming and Scripting
Hi Everyone,
I have a flatfile "inbox.txt" which contains some information:
Location 0, folder "Inbox", SIM memory, Inbox folder
SMS message
SMSC number : "+24800000023"
Sent : Sat 04 Aug 2012 09:01:00 PM +0700
Coding : Default GSM alphabet... (5 Replies)
Discussion started by: testcase
5 Replies
5. UNIX for Dummies Questions & Answers
I made a screen within a screen.
Is there a way to move the inner screen up one level so that it is at the same level as the first screen running from the shell? (2 Replies)
Discussion started by: phpchick
2 Replies