Forum: Shell Scripting Dec 1st, 2008 |
| Replies: 7 Views: 1,113 no - a job is still a single process. Jobs in fact are controlled by their Process ID.
eggi has it right - basically the only "difference" is that you can manage a job through the job manager... |
Forum: Shell Scripting Nov 28th, 2008 |
| Replies: 12 Views: 2,626 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. |
Forum: Shell Scripting Nov 28th, 2008 |
| Replies: 7 Views: 1,113 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... |
Forum: Shell Scripting Nov 6th, 2008 |
| Replies: 3 Views: 901 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... |
Forum: Shell Scripting Nov 6th, 2008 |
| Replies: 3 Views: 71,434 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... |
Forum: Shell Scripting Nov 6th, 2008 |
| Replies: 3 Views: 1,074 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.... |
Forum: Shell Scripting Nov 6th, 2008 |
| Replies: 3 Views: 15,331 Hey - alternatively you can do this natively with the at command:
at now +3 days <enter>
/path/to/script <enter>
Ctrl-D
The at command actually waits for a Ctrl-D (EOF) for termination. ... |
Forum: Shell Scripting Nov 6th, 2008 |
| Replies: 9 Views: 3,243 Your first problem is that you need to define the function above where you call it from - so you should have a functions section at the top of your script, which is where my code should be. I'm... |
Forum: Shell Scripting Aug 13th, 2008 |
| Replies: 3 Views: 1,796 In my opinion, the easiest way to do this is simply:
net start messenger || echo Messenger service is currently disabled on your computer. Press F1 for instructions to enable this service.
... |
Forum: Shell Scripting Aug 8th, 2008 |
| Replies: 6 Views: 1,536 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... |
Forum: Shell Scripting Aug 7th, 2008 |
| Replies: 5 Views: 7,291 I want to go to school where you people all go. My college classes were pretty limited. |
Forum: Shell Scripting Jul 25th, 2008 |
| Replies: 6 Views: 1,012 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... |
Forum: Shell Scripting Jul 24th, 2008 |
| Replies: 6 Views: 1,137 ^ Nice and simple, just the way I like it... though I'm more interested in the sed example. |
Forum: Shell Scripting Jul 24th, 2008 |
| Replies: 6 Views: 2,324 with my above function:
while [ "$*" != "" ]
do
working_arg=`test_upper $1`
if [ "x${working_arg}x" != "xx" ]; then
echo "$working_arg is all lowercase."
fi
shift |
Forum: Shell Scripting Jul 23rd, 2008 |
| Replies: 1 Views: 793 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. |
Forum: Shell Scripting Jul 23rd, 2008 |
| Replies: 6 Views: 2,324 Try this:
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 |
Forum: Shell Scripting Jul 23rd, 2008 |
| Replies: 6 Views: 1,787 The text is available, it was just a bit hard to read because you hadn't enclosed it in code tags.
It doesn't look like an overly complicated script - though I wonder if you have racadm installed?... |
Forum: Shell Scripting Jul 22nd, 2008 |
| Replies: 4 Views: 1,067 Niether of those solutions worked for me exactly as specified, however the following command worked fine:
$ for file in `tar tvf /u8/sp_archive/2005.tar | grep 1274 | awk '{print $9}'`
> do
>... |
Forum: Shell Scripting Jul 22nd, 2008 |
| Replies: 6 Views: 1,787 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... |
Forum: Shell Scripting Jul 17th, 2008 |
| Replies: 4 Views: 1,067 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... |
Forum: Shell Scripting Jul 16th, 2008 |
| Replies: 5 Views: 5,114 It actually probably should be in most secure environments...
Try this one:
telnet $mailserver <<END
user $USER $PWORD
/path/to/HELO
exit
END |
Forum: Shell Scripting Jul 8th, 2008 |
| Replies: 2 Views: 1,045 The above from Salem's post needs to be done to fix your issue.. but you may also want to fix your if statement.
if [ "$result" = "$next" ]
The data in these variables are strings and... |
Forum: Shell Scripting Jul 2nd, 2008 |
| Replies: 1 Views: 634 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... |
Forum: Shell Scripting Jul 1st, 2008 |
| Replies: 1 Views: 704 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... |
Forum: Shell Scripting Jun 29th, 2008 |
| Replies: 6 Views: 3,509 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... |
Forum: Shell Scripting Jun 27th, 2008 |
| Replies: 2 Views: 2,171 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... |
Forum: Shell Scripting Jun 27th, 2008 |
| Replies: 1 Views: 1,349 #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 |
Forum: Shell Scripting Jun 26th, 2008 |
| Replies: 4 Views: 3,936 username="myUser"
password=`cat dummy.txt`
# alternatively:
#password=$1
telnet 172.11.11.21 8101 <<EOF
$username
$password
#insert command here
EOF |
Forum: Shell Scripting Jun 19th, 2008 |
| Replies: 9 Views: 3,243 A final script that parses cents, if input using a dot ("."):
function formatCurr {
dollar_amt=$1
cents=`echo $dollar_amt | grep '\.'`
if [[ "x${cents}x" != "xx" ]]
then
cent_amt=`echo... |
Forum: Shell Scripting Jun 18th, 2008 |
| Replies: 9 Views: 3,243 Try the following out:
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 |
Forum: Shell Scripting Jun 11th, 2008 |
| Replies: 5 Views: 1,277 I like your answer as well - but didn't see where you started your search before I started replying (hence why I mentioned my find returns a relative path). By the time I noticed it, I was too far... |
Forum: Shell Scripting Jun 9th, 2008 |
| Replies: 5 Views: 1,277 ^ 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... |
Forum: Shell Scripting Jun 5th, 2008 |
| Replies: 2 Views: 920 When I am trying to do something to all users in the /home directory, I will do something like this:
for user in `ls /home`
do
#insert action here
#mail -s "Subject" -f "file" -c... |
Forum: Shell Scripting Jun 5th, 2008 |
| Replies: 1 Views: 1,325 try this:
LINECHANGE=`sed s/${OLDLINE}/${NEWLINE}/ ${filename}` |
Forum: Shell Scripting Jun 5th, 2008 |
| Replies: 4 Views: 2,373 alright, if no one else is going to spill it, method 4 is "echo pwd"
1. PATH="${PATH}:echo pwd" # echo pwd
2. PATH="${PATH}:" # null
3. PATH="${PATH}:." # dot
4. PATH="${PATH}:${PWD}" #$PWD |
Forum: Shell Scripting Jun 3rd, 2008 |
| Replies: 2 Views: 2,620 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... |
Forum: Shell Scripting Jun 3rd, 2008 |
| Replies: 4 Views: 2,373 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:
... |