04-05-2016
is there anything wrong with my code?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear All,
I'm trying to write a shell script that continously checks a certain folder. When a file is placed in the directory securely copies the file to another server.
I've got the secure copying working, but I don't know how to contiously check a directory for a new file and then use that... (3 Replies)
Discussion started by: duncan_glover
3 Replies
2. Shell Programming and Scripting
I have a folder with lots of file. e.g. a.txt, b.txt, c.txt.... I want to put these files from the source directory and place them in a destination directory in a specific order, such as /destination/a/a.txt, /destination/b/b.txt, /destination/c/c.txt, ......
Please help. Thx :confused: (3 Replies)
Discussion started by: aaron_fong
3 Replies
3. Shell Programming and Scripting
:)
Hi,
I want to script for this scenerio,
OSR Settings
Scenario : We are looking to find all the *.a files from the following locations in the filesystem of a server.
OSR Directories
/etc
/bin
/usr/bin
/usr/sbin
/var/adm
These *.a files should have the permissions on... (12 Replies)
Discussion started by: sakthilinux
12 Replies
4. Shell Programming and Scripting
. ./testFile.sh
url=http://ichart.finance.yahoo.com/table.csv?s= suf=&d=5&e=9&f=2009&g=d&a=1&b=4&c=1999&ignore=.csv
wget $url$s1$suf;
sleep 10;
cat header.txt > $s1.txt;
chmod 777 $s1.txt;
sed '1d' table.csv?s\=$s1 >> $s1.txt;
rm -Rf table*
Very new at shell scripting as you can see... (3 Replies)
Discussion started by: harte
3 Replies
5. Shell Programming and Scripting
I have been following a tutorial on bash which has proven to be very helpful. However, i am stuck with a command not found issue when asking for a y/n response from the user. Below is the part of code I believe is giving me grief... I have been trying to work through this for 3 hours now.... Please... (5 Replies)
Discussion started by: brokepunk
5 Replies
6. Shell Programming and Scripting
Hello,
I'm new to Sheel script and I need your help for a script I need to develop (for me).
Indead, I have a software which log all entry from internet and save it in text file.
But, the log is practically unreadable because every 256 characters jump to a new line (even if the message is... (5 Replies)
Discussion started by: acidoangel
5 Replies
7. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
"Create a shell script that changes the selected word to another word in all files from selected archive. The... (1 Reply)
Discussion started by: oibanuelos
1 Replies
8. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
Arguments:
http://farm9.staticflickr.com/8070/8212131370_8b6e8c10c5_c.jpg
I am given these three arguments. $1, $2, $3
The first argument is the path to a directory.
So, how would I go into the directory and compare files?
I... (5 Replies)
Discussion started by: spider-man
5 Replies
9. UNIX for Dummies Questions & Answers
while
do
if ;then
read driverName
else
driverName=""
fi
done
can anyone please explain what exactly is happening on 1st line...is it like the conditions being ORed...I have no clue about this. (4 Replies)
Discussion started by: rtagarra
4 Replies
10. UNIX for Beginners Questions & Answers
Hi everyone, first time visitor to these forums here.
Keeping a long story short I've been attempting to learn how to code in bash. I have VERY little previous experience with coding languages besides simply copying and pasting batch scripts for Windows. So, with that in mind I've followed a... (4 Replies)
Discussion started by: Meta
4 Replies
error(n) Tcl Built-In Commands error(n)
__________________________________________________________________________________________________________________________________________________
NAME
error - Generate an error
SYNOPSIS
error message ?info? ?code?
_________________________________________________________________
DESCRIPTION
Returns a TCL_ERROR code, which causes command interpretation to be unwound. Message is a string that is returned to the application to
indicate what went wrong.
The -errorinfo return option of an interpreter is used to accumulate a stack trace of what was in progress when an error occurred; as
nested commands unwind, the Tcl interpreter adds information to the -errorinfo return option. If the info argument is present, it is used
to initialize the -errorinfo return options and the first increment of unwind information will not be added by the Tcl interpreter. In
other words, the command containing the error command will not appear in the stack trace; in its place will be info. Historically, this
feature had been most useful in conjunction with the catch command: if a caught error cannot be handled successfully, info can be used to
return a stack trace reflecting the original point of occurrence of the error:
catch {...} errMsg
set savedInfo $::errorInfo
...
error $errMsg $savedInfo
When working with Tcl 8.5 or later, the following code should be used instead:
catch {...} errMsg options
...
return -options $options $errMsg
If the code argument is present, then its value is stored in the -errorcode return option. The -errorcode return option is intended to
hold a machine-readable description of the error in cases where such information is available; see the return manual page for information
on the proper format for this option's value.
EXAMPLE
Generate an error if a basic mathematical operation fails:
if {1+2 != 3} {
error "something is very wrong with addition"
}
SEE ALSO
catch(n), return(n)
KEYWORDS
error
Tcl error(n)