Search Results

Search: Posts Made By: wolfv
1,581
Posted By wolfv
Thanks vgersh99, ${HOME} worked!
Thanks vgersh99, ${HOME} worked!
1,581
Posted By wolfv
How to print contents of file when the file path is in a variable?
The file f1 contains the text "body" (shell prompt is "$"):
$ cat ~/path/f1
body

How to print contents of f1 when the f1 path is in a variable?
Here is my failed attempt:
$ f1="~/path/f1"
$...
2,477
Posted By wolfv
I want a list of all PDF files, excluding file...
I want a list of all PDF files, excluding file names ending in "_nobackup.pdf" or "_nobackup.PDF", and don't even look in folders ending in "_nobackup".
2,477
Posted By wolfv
find . -path "*_nobackup*" -prune -iname "*.PDF" \( ! -name "*_nobackup.*" \)
These three finds worked as expected:
$ find . -iname "*.PDF"
$ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \)
$ find . -path "*_nobackup*" -prune -iname "*.PDF"

They all returned the...
14,131
Posted By wolfv
That fixed it! :b: Thank you RudiC and everyone...
That fixed it! :b:
Thank you RudiC and everyone else that helped along the way.
I could not have done it without you.

The following example works as intended.

$ cat tests.sh:
#!/bin/bash...
14,131
Posted By wolfv
I didn't know about xtrace. Nice. Thanks for...
I didn't know about xtrace. Nice. Thanks for the tip.
Running ../tut0/load.sh directly works fine.
But test.sh is not calling ../tut0/load.sh.

$ cat tests.sh
#!/bin/bash
echo "in tests.sh...
14,131
Posted By wolfv
Good idea. The pwd and ls outputs are as...
Good idea. The pwd and ls outputs are as expected. But load.sh never gets called.
Why is load.sh not called?

$ cat tests.sh
#!/bin/bash
echo "in tests.sh --------"
echo "pwd:"
pwd
echo...
14,131
Posted By wolfv
similar example with different paths
The example in post #9 works, it has all the files in one directory.
A C++ function main(), returns an error code (1 means EXIT_FAILURE).
The error code is passed from the main() function, to...
14,131
Posted By wolfv
solved
Thank you Scrutinizer, that worked. Outputs are as expected!

test.sh:

#!/bin/bash
if ./load.sh
then
echo "0"
else
echo "1"
fi


load.sh:
#!/bin/bash
main
rc=$?
echo $rc...
14,131
Posted By wolfv
Thanks Don Cragun. I tried the scripts you...
Thanks Don Cragun.

I tried the scripts you suggested in my load.sh file, but get the same result.

load.sh:
#!/bin/bash
main
rc=$?
exit $rc


From command line:
$ ./tests.sh
0

Bash...
14,131
Posted By wolfv
Sorry I left out the bash header. I am using...
Sorry I left out the bash header. I am using Bash.

I have several load.sh scripts, and want to call them all from one test.sh script.
Each load.sh script calls a C++ function that returns an...
14,131
Posted By wolfv
Returning an exit code from a bash function
How to return a exit code from a function and use it in conditional?
I tried the following but it does not seem to work.

tests.sh:
if test ./load.sh ; then
echo "0"
else
echo "1"
fi...
Forum: Cybersecurity 08-24-2011
5,307
Posted By wolfv
Thank you for your responses
Alister,
Yes, my bank uses HTTPS. But it is too easy to purchase a digital certificate.

pludi,
I like the VM for online banking idea. I will investigate that.
Forum: Cybersecurity 08-22-2011
5,307
Posted By wolfv
Dedicate browser for secure online banking?
I currently keep a hosts file to make my online banking more secure. But that won’t help in the event of a DNS-cache-poisoning zero-day attack. Is the following solution practical?

Dedicate one...
3,259
Posted By wolfv
Thanks methyl, that worked:b:var=10 echo $var ...
Thanks methyl, that worked:b:var=10
echo $var
. ./job
echo "var=$var"
3,259
Posted By wolfv
rekha_sri, I ran the code you suggested, but...
rekha_sri,

I ran the code you suggested, but the script did not find the file "job" filewolf-PC:~/computer_languages/UNIX/sp> ./exe_str
10
.: 4: job: not found
The "job" file and the "exe_str"...
3,259
Posted By wolfv
How to execute commands read from another file?
Please help with this simple example. I can not figure out how to do it. A file named “job” contains only this one line:var=5I need a script to read the job file and execute it as a command. This...
32,022
Posted By wolfv
Where else?
abubacker,
I didn't know where else to put an rsync tutorial. Is there a place that would be more easily found by rsync newbies?

Thank you.
32,022
Posted By wolfv
rsync tutorial for newbies
Hi. Learning rsync from the man pages can be daunting. I wrote this tutorial to make learning rsync easier:

rsync tutorial (rsync2u) (http://sites.google.com/site/rsync2u/home/rsync-tutorial)
...
17,052
Posted By wolfv
Thanks for all your suggestions. The echo string...
Thanks for all your suggestions. The echo string needed quotes. The following examples worked.
#!/bin/sh

#concatinating with leading dash
#All output "-n test" (echo string needs quotes)
...
17,052
Posted By wolfv
vidyadhar85, I am using the Debian Almquist...
vidyadhar85,
I am using the Debian Almquist shell (came with Ubuntu 9.04).

gaurav1086,
I retried with single quotes, but got the same results.
#not working with dashes
var2='-n $var1'
echo...
17,052
Posted By wolfv
How to concatenate string containing a leading dash?
Is there a way to concatenate two strings, where the first string is "-n" and there is a space between the "-n" and the second string? Below are some examples of what I tried.
#!/bin/sh
var1=test...
13,166
Posted By wolfv
Thank you for all your suggestions. I have...
Thank you for all your suggestions. I have incorporated some of your suggestions into the script, and updated the script (in the first post...
13,166
Posted By wolfv
steadyonabix, Thanks for the suggestion. ...
steadyonabix,

Thanks for the suggestion. Here is the code change:
abort()
{
echo "$1"
echo "Backup aborted"
exit
}

#check destination_path
if [ ! -d "$destination_path" ]
then...
13,166
Posted By wolfv
Showing off my rsync-to-USB script
Thank you all for helping me figure out how to manage spaces in paths. The following script is the result. The script uses rsync to backup files to a USB device. Special thanks to Scrutinizer:b:....
Showing results 1 to 25 of 36

 
All times are GMT -4. The time now is 11:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy