Hello everybody...
I'm a Unix newbie and i just got this task at work to figure out what's wrong with a daily script my team is using.
The idea behind the script is that it takes the day before in a yyyymmdd format, find files with that date in a specific directory and executes an (irrelavant)... (4 Replies)
The script is called php-ping and it is taken from theworldsend.net
I modified it so that instead of ping he will execute another command called scr
witch telnets to a switch and changes the vlan on an interface
the telnet script:
#! /bin/bash
(
sleep 0.2;
echo admin;
sleep 0.2;
echo... (1 Reply)
hi, i was required to write a shell script to get yesterday's date flatfile. but i only know how to get today's date flatfile. Please observed my below scripting: Please help! Thanks
=================================================
#!/bin/sh
HOST='192.168.1.200'
USER='ftp1'... (19 Replies)
This is probably archaic, but I'm new to unix and this is my first shell script. I'm writing this script to use in another script. All I am trying to do is make the parts of the output from date usable in my other script. I was wondering if you could stand looking at this and see if you notice... (8 Replies)
Hello,
I'm very new to script writing - everything I have I got off the Internet. I'm pretty sure I stole this date script from this site.
Anyway, the script works great until I try to obtain a date that falls into last year. I can get 'Dec 31, 2009' but nothing earlier. Below is the... (3 Replies)
Hi All,
This Monday 15th March 2010, i have faced a weired issue with my Perl script execution, this script is scheduled to run at 1 minute past midnight on daily basis ( 00:01 EST ) generally for fetching previous business date , say if it is Monday it should give last Friday date, for Tuesday... (0 Replies)
$result = shell_exec("/sbin/checkscript.sh jdoe");
echo "$result" ;
i am running a script through php. the script is /sbin/checkscript jdoe.
this script is supposed to output something similar to this:
################################
#### Welcome John Doe... (0 Replies)
my $sysdate = strftime('%Y-%m-%d', localtime );
biDeriveByDate('Table_Str',$sysdate,\@lIndx,\@lResVals)
In a perl script, when I'm trying to pass $sysdate to some external function it's not working since $sysdate is passed as a string mentioned above but my function is expecting a date value... (1 Reply)
I have file listed like below
-rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz
-rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz
-rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz
-rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz
-rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz
I... (5 Replies)
i am beginner in bash scripting and i am looking for a command that gives me one minute ago. i am working on unix ware7 and i cant use date -d or date --date command
thanks for help !! (4 Replies)
Discussion started by: rezasadeghi
4 Replies
LEARN ABOUT MOJAVE
code
code(n) [incr Tcl] code(n)
__________________________________________________________________________________________________________________________________________________NAME
code - capture the namespace context for a code fragment
SYNOPSIS
itcl::code ?-namespace name? command ?arg arg ...?
_________________________________________________________________DESCRIPTION
Creates a scoped value for the specified command and its associated arg arguments. A scoped value is a list with three elements: the
"@scope" keyword, a namespace context, and a value string. For example, the command
namespace foo {
code puts "Hello World!"
}
produces the scoped value:
@scope ::foo {puts {Hello World!}}
Note that the code command captures the current namespace context. If the -namespace flag is specified, then the current context is
ignored, and the name string is used as the namespace context.
Extensions like Tk execute ordinary code fragments in the global namespace. A scoped value captures a code fragment together with its
namespace context in a way that allows it to be executed properly later. It is needed, for example, to wrap up code fragments when a Tk
widget is used within a namespace:
namespace foo {
private proc report {mesg} {
puts "click: $mesg"
}
button .b1 -text "Push Me" -command [code report "Hello World!"]
pack .b1
}
The code fragment associated with button .b1 only makes sense in the context of namespace "foo". Furthermore, the "report" procedure is
private, and can only be accessed within that namespace. The code command wraps up the code fragment in a way that allows it to be exe-
cuted properly when the button is pressed.
Also, note that the code command preserves the integrity of arguments on the command line. This makes it a natural replacement for the
list command, which is often used to format Tcl code fragments. In other words, instead of using the list command like this:
after 1000 [list puts "Hello $name!"]
use the code command like this:
after 1000 [code puts "Hello $name!"]
This not only formats the command correctly, but also captures its namespace context.
Scoped commands can be invoked like ordinary code fragments, with or without the eval command. For example, the following statements work
properly:
set cmd {@scope ::foo .b1}
$cmd configure -background red
set opts {-bg blue -fg white}
eval $cmd configure $opts
Note that scoped commands by-pass the usual protection mechanisms; the command:
@scope ::foo {report {Hello World!}}
can be used to access the "foo::report" proc from any namespace context, even though it is private.
KEYWORDS
scope, callback, namespace, public, protected, private
itcl 3.0 code(n)