- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
43 Posted Topics
Re: It actually probably should be in most secure environments... Try this one: [code] telnet $mailserver <<END user $USER $PWORD /path/to/HELO exit END [/code] set up the mailserver, USER and PWORD variables accordingly. You usually need to authenticate with telnet. | |
Re: You have already been told - just use the mail command to do what you want to do, nested in the logic you want it done for. For instance, the following will check to see if a file exists every 3 minutes. If the file exists, it will e-mail the … | |
Re: Try this: [code] g++ "C:\HellowWorld.cpp" 2> "C:\output.log" [/code] You could probably also do: [code] g++ "C:\HellowWorld.cpp" 1>2> "C:\output.log" [/code] Just in case stdout did produce any output. 2 specifies that "standard error" or "stderr" or errors be redirected; 1 is standard output or "stdout" - that is, anything that the … | |
I am trying to keep formatting between cell references. For instance, I have a date in once cell (J9) and would like to add this date to a text field so e.g.: ="This will take effect on " & J9 & "." However, when I do this, I end up … | |
Unfortunately, I don't think this question is solved with a simple vlookup, or etc. I have a spreadsheet that has several tables of data with the following format on one sheet: gxxxx gxxxx gxxxx zzzzz gxxxx gxxxx gxxxx zzzzz The "g"s above would indicate an item for lookup. The "z"s … | |
Re: Your phone numbers and addresses should have foreign keys to the contact table - not to the person table. e.g. Swap out p_id for c_id. THis is what he means by "- Events, addresses and phones belong to contacts, not the user (person in your case), as you had indicated." … | |
Re: I didn't realize you could call vi in a script like that and execute sed from there - I always sed the file and output to a temp file, and then read back in to the original... this is much cleaner. | |
Re: A job is a process running in the background. E.g. ./myscript.sh & [1] myscript.sh 96243 A job relates to a command run from a terminal. It is attached to a terminal session. A command can be run in the background if it doesn't require any user input, and you want … | |
Re: SQL Server creates primary keys (by default) as clustered - which means it gets sorted. Create a NONCLUSTERED primary key and you should be all set. | |
I would like to create a variable in my trigger - @DBNAME. When the trigger executes, this value should be set to the name of the database it was executed in. E.g. for the master database the value of @DBNAME would be master. How would I go about figuring out … | |
Re: Another suggestion - since it looks like you are comparing military time, it will be easier to make the comparison if you drop the ":". You can do this with sed or tr or even cut very easily. After that, you can do the if comparison. Otherwise you will need … | |
Re: Mike, Definitely some genius code there.... the one thing you missed is that it needs to skip a column.... I was hoping you could just increment i by 2 - but that doesn't seem to work... I really don't know all that you are doing there, so I was unable … | |
Re: Hey - alternatively you can do this natively with the at command: [code] at now +3 days <enter> /path/to/script <enter> Ctrl-D [/code] The at command actually waits for a Ctrl-D (EOF) for termination. You can feed it an entire command by echoing want you want to run and piping that … | |
Re: Try the following out: [code] function formatCurr { dollar_amt=$1 length=`echo $dollar_amt | awk '{ print length($0) }'` mod=`expr $length % 3` div3=`expr $length / 3` if [[ $mod -ne 0 ]] then dollar_pt0=`echo $dollar_amt | cut -c 1-$mod` fi dollar_fin=`echo "${dollar_pt0}"` modp1=`expr $mod + 1` incr=`expr $mod + 3` for … | |
Re: Ancient Dragon is correct, there is no way of manipulating threads using batch - or in other words, there is no command redirection available under command.com which allows you to send command output from a control-c into the input thread of a running program. You would have to use a … | |
Re: In my opinion, the easiest way to do this is simply: [code] net start messenger || echo Messenger service is currently disabled on your computer. Press F1 for instructions to enable this service. [/code] As opposed to && which would run the second command (the echo) only if the first … | |
Re: Have you tried removing the semi-colon after the first line and tried running it that way? In my experience, I only put a semi-colon there if the do will be put on the same line. I think that is unnecessary - let me know how that works out, because other … | |
Re: I want to go to school where you people all go. My college classes were pretty limited. | |
Re: I have never written pseudocode before - but I was under the assumption that you did not need to define variables - you just basically went through and wrote out (in a human readable format that looks like programming) the logic of the program. [url]http://en.wikipedia.org/wiki/Pseudocode[/url] For instance: [code=pseudocode] calculate_attendance( classes_attended, … | |
Re: Try this: [code] function test_upper { test=`echo $1 | grep [A-Z]` if [ "$?" = "0" ]; then #Uppercase letters found. #translate to lower case: echo $test | tr '[A-Z]' '[a-z] else #letters are all lowercase, return them. echo $1 fi } [/code] Not exactly sure what you want your … | |
Re: ^ Nice and simple, just the way I like it... though I'm more interested in the sed example. | |
Re: The best thing to do would be to find someone who is fluent in both vbs and shell scripting in order to have them convert the script for you. This may cost some money, especially depending on the size of the project. The thing of it is, is that most … | |
Re: Which part are you having trouble with? I would have to know a little bit more about the naming scheme of your zip files and etc. | |
Hey, I'm trying to unpack certain files from a tar archive - I don't want to unpack all of the 1.2GB file, just a particular bunch of it. I tried an obvious command: tar xvf /u8/sp_archive/2005.tar *1274* All files I want to extract have "1274" in the name; I want … | |
Re: If this is PCL compatible, I can certainly help with that. If its PostScript help you need, then I probably can't be of much assistance. Can you identify the model of the printer, and whether or not there is a PCL driver available for it? Preferably a PCL 5 or … | |
Re: The above from Salem's post needs to be done to fix your issue.. but you may also want to fix your if statement. [code] if [ "$result" = "$next" ] [/code] The data in these variables are strings and need to be compared as such. It probably isn't necessary, but … | |
Re: I can only think of using a log file of sorts. At the beginning of your first script have it output a '0' (false) to the log file. At the end of the script, upon successful execution, have it output a '1'. In your second script you can then read … | |
Re: [code] username="myUser" password=`cat dummy.txt` # alternatively: #password=$1 telnet 172.11.11.21 8101 <<EOF $username $password #insert command here EOF [/code] | |
Re: Well, you will not make it very far in UNIX System administration without knowing Shell scripting. You will also do well with UNIX admin with C/C++ under your belt - or perhaps some python or maybe preferably Perl (depending on who you ask). I would say with Microsoft System Administrator … | |
Re: You are only returning (echoing) the last iteration of badcommand. Your while/for/if loop above assigns the current argument that it is processing to the badcommand variable. You let that loop run through all arguments and THEN exit out of the loop and echo. It's only echoing the last command it … | |
Re: I would also wrap your sql in some code=sql tags. It's hard to see everything - but for instance, it looks like you have some mixed and/or missing quotes | |
Re: Yeah... where are you taking this "quiz"? You seem to have a lot of questions, and it is certainly hard to tell if its because you are trying to learn or cheat. If its just an online quiz - can you provide a link? I'd be interested in taking a … | |
Re: In order just to type the name of the file to execute, it needs to be in an executable directory - so for e.g. if you have a script that is used frequently, drop it in /usr/local/bin and it will become executable from anywhere. You can also add the current … | |
Re: [code] #usage myscript.sh filename filename=$1 #read argument "filename" if [ -f $filename ] #if file exists then #print it lp $filename else #create it touch $filename fi [/code] | |
Re: Yes, export the data as csv - you can do this easily with DTS; or you can do with BCP from the command line: [code] C:\> BCP database.dbo.table out mytable.csv -S<servername> -Uusername -Ppassword [/code] DTS may better serve you. Then upload it to your web server and load into mysql … | |
| |
Re: ^ My find command returns a relative path from the current directory - I believe this is how most find commands work. You can write an advanced function to find the absolute path name, but here is how I would do this: [code] $ cd `find /usr/local -name "jdk1.6*" -type … | |
Re: When I am trying to do something to all users in the /home directory, I will do something like this: [code] for user in `ls /home` do #insert action here #mail -s "Subject" -f "file" -c "${user}@student.uml.edu" done [/code] | |
Re: try this: [code] LINECHANGE=`sed s/${OLDLINE}/${NEWLINE}/ ${filename}` [/code] | |
Re: What this question means is "What can you specify in your PATH environment variable which wil allow you to run scripts in the current directory." For instance, my default PATH variable is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games omrsafetyo@kulas-net:~$ echo "echo it worked" > script1 omrsafetyo@kulas-net:~$ script1 bash: script1: command not found But, if I … | |
Re: No, thats actually exactly wrong. The mv command does not make a new file. Period. The datablocks holding the information remain unchanged. All that happens is that the entry in the directory file that holds the inode information is copied to the new directory, and then the inode information is … | |
Re: I don't know of any command that will do this directly for you - and awk would probably be the way to go, but I'm no awk guru. This could probably also be done through some very impressive sed magic - but again, I'm no sed guru. So doing this … |
The End.