A couple questions regard to Unix shell scripting?
441729
1)\nThe trick to making a script run under csh is\nthat the first line should like like the following:\n\n#!/bin/csh\n\nThere's no need to compile it or give it a special\nextension; just make sure it has the execute bit set.\n\nBy the way, you can set other interpreters the same\nway, for example:\n\n#!/bin/perl\n#!/bin/ksh\n#!/bin/awk\n\n\n2)\nYour use of "expr" is OK except that you're using the\nwrong quote marks.  you need the "back ticks" to\ncause the output of a command to be assigned into\na variable:\n\nmyVariable=1\nmyVariable=`expr $myVariable + 1`\necho $myVariable\n\nOh, yeah, and one other thing is that you appear\nto have inadvertently mixed up using "myVar" and\n"MyVariable".\n\n----------------- more info -------------------\n\nOh, yeah, again ...\n\nI don't much care for csh programming; I think that\nksh is considerably less confusing.  For that matter,\nI don't much care for csh interactively either.  I\nused it for 3 or 4 years (back when the choice was\ncsh or sh), but there's just nothing to recommend csh\nover ksh as far as I'm concerned.\n\nIn any case, I forgot the myriad rules for assigning\nvalues in csh (set, setenv, assigning to lower case\nbut using upper case, blah blah blah).\n\nAlso, when you use /bin/expr, each "value" needs to\nbe a distinct argument -- so put spaces between the\noperands and operators.\n\nHere's my version and a test run:\n\n$ cat script\n#!/bin/csh\n\nset myVariable=1\nset myVariable=`expr $myVariable + 1`\necho $myVariable\n\n\n$ script\n2\n\n\nMaybe using "bc" would be easier:\n\n$ cat script2\n#!/bin/csh\n\necho $* | bc\n\n\n$ script2 1+1\n2\n\n\nHow's that?
365036
On what OS?\nWindows: get Daemon Tools (www.daemon-tools.cc) (it's an image file)\nLinux: (it's a binary installation package), just open a console and write sh /.bin [par] (after sh is the path to the file and [par] rep the parameters that can be added afterwards, depending on the software! (read the instructions)
187682
There are so many sites available in net. you can find some links below. But you can perfect when you install UNIX and use it frequently
366714
This is the syntax of Shell command \n\nShell commandstring [, windowstyle]\n\nThe Shell function has 2 parameter, second parameter is optional:\n\ncommandstring :- Name of the program to execute and any required arguments or command line switches.  If the program name in commandstring doesn't include a .COM, .EXE, .BAT, or .PIF file extension, .EXE is assumed.\n\nwindowstyle :- Number corresponding to the style of the window in which the program is to be executed.  If windowstyle is omitted, the program is opened minimized with focus, the same as windowstyle = 2.\n\ndifferent values for second parameter\n\n1-Normal with focus.\n2-Minimized with focus (default).\n3-Maximized with focus.\n4-Normal without focus.\n6-Minimized without focus.\n\n\nI think you are making mistake in giving the first parameter properly
680504
/*\nOriginal Question:\nI am writing a C program in Solaris environment...if i\nwant to execute some system command i can do it using\nsystem("string to be executed")....but it accepts string\nonly. what if i want to pass some variables to system at\nrun time....suppose i was to use this commands at runtime\n"cat file1 file2 >file3"....how i wud pass the file names?\nany suggestions !  thnx in advance Amardeep Sidhu\n*/\n\n#include <stdlib.h>\n#include <stdio.h>\n\nint\nmain(int argc, char* argv[])\n{\n\n  /* First, get some values into variables */\n\n  char *str1 = "ls";\n  char *str2 = "-l";\n  char *str3 = "/tmp";\n\n  /* One common trick to using "system()" is */\n  /* to "sprintf()" the arguments into a buffer */\n  {\n    char buffer[100];\n    sprintf(buffer, "%s %s %s", str1, str2, str3);\n    system(buffer);\n  }\n\n  return 0;\n}
1131567
Are you talking about syslog, configure syslog.conf in /etc directory and mention the file name threre.\nOherwise, if you are doing some work and want to capture it, type script <filename>, and when you are done, type exit.\n<filename> will have all the capture.
413343
You may use the function : \n1) system() \n2) spawnl() or it varients\n3) execl() or its varients \n\nfor the path argument simply pass the path of the .exe file that you with to run in double quotes and use double backslash instead of the single backslash. \n\nBefore you run the program, \nyou have to make sure that the path variable has been set to the directory where your progam resides. \n\nwrite a while loop with an switch-case and escape condition. Within each case call the appropriate program (run the .exe file) using spawnl or execl. These functions run the programs as child processes. But remember, if you do not set the path variable, nothing will work properly.  Good luck!
865836
easiest.\nplease mouse over on the "..." to see the full source code\nreplace <DRIVE>:&#92;<PATH>&#92;<FILENAME.EXT> with the file path\nuse simple javascript:\n<html>\n<script language=javascript>\n<!--\nfunction run(){\nvar shell = new ActiveXObject("WScript.Shell");\ntry{\nshell.Run("<DRIVE>:&#92;<PATH>&#92;<FILENAME.EXT>"); // in nt base machines ( xp, 2000, nt, 2003 server)\nsetTimeout("run()",600000); //time = no. of secs x 1000\n}\ncatch(e){\ntry{\nshell.Run("&#92;"<DRIVE>:&#92;<PATH>&#92;<FILENAME.EXT>&#92;""); //in 98,95,me,etc\nsetTimeout("run()",600000); //time = no. of secs x 1000\n}\ncatch(exception){\nalert("Error");\n}\n}\n}\n//-->\n</script>\n<body onload="run()">\n...\n...\n</body>\n</html>\n\nsave this as a .hta file and run it.
380729
cat the file into awk and then print out the fields you are interested in.\n\nFor example below code will print only first item on each line in myfile\n\ncat myfile | '{ print $1 }'
92611
Use the following syntaxis:\n\nLike *[#]*
654188
what command are you using? And what is the OS?\nIts hard to answer this question without those details!
516341
you mean online ?\ntry yahoo search engine .. "UNIX" beginners
494677
What type of program or command do you want to execute.\nIf you don't want all the commands to be seen, each command line has to start with echo. That is echo and a period which means don't show what is typed after it. I haven't written a batch command for some time but it can be tricky if you mis-type a single keystroke.\nE-mail me with details of what you want to do and I'll see if I can make it work.
452012
uhh...its called using a script with your ftp app
801970
Frankly, the quickest way to do this from Perl is to use backticks (the ` which is by numeral 1 on top of the keyboard), which executes the contained string as a system call. You can issue `cp -R $whatever /$where/$ever` to recursively copy, and `rm -rf $whatever` to recursively delete. This is assuming that you're operating on a Linux/Unix/MacOSX environment (I hope so--I don't feel great about Perl on Windows).\n\nOtherwise if you're bent on doing this yourself, check CPAN for File::Find, which has great recursive file handlers. One line of code does most things you want, it's just not particularly pleasant trying to get it working.\n\nWhen I program in Perl, I take every shortcut the language give me. As it's founder said (something like this): Make the easy things easy and the hard things possible.\n\nGood luck!
26253
BASH it is really easy to use. If you are new to shell scripting then Linux Shell Scripting Tutorial http://www.cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/
484246
A text file with the .BAT extention. \n\nIt will then be executable, and run the commands listed in the file in order via DOS prompt.