05-24-2008
Thanks for your reply.
I tried both your suggestions.
The first produced this output:
[root@ip-111-222-333-444 mydir]# bash -xv commands.bash
touch -c -t 200402032227.47 "./var/www/vhosts/mydomain.com/mydir/testFolder/test.txt"
+ touch -c -t 200402032227.47 ./var/www/vhosts/mydomain.com/mydir/testFolder/test.txt
touch -c -t 200302032227.47 "./var/www/vhosts/mydomain.com/mydir/testFolder/test2.txt"
+ touch -c -t 200302032227.47 ./var/www/vhosts/mydomain.com/mydir/testFolder/test2.txt
I'm not really sure how to interpret what this means, though.
The other suggestion produced an error "bash: /usr/bin/touch: No such file or directory". I probably misunderstood what you were describing that I should do in my suggestion, though. This was the command I typed:
[root@ip-111-222-333-444 /]# /usr/bin/touch ./var/www/vhosts/mydomain.com/mydir/commands.bash
Thanks for your suggestions so far. Any more advice would be very much appreciated.
Viola
10 More Discussions You Might Find Interesting
1. Solaris
Hi, i would like a help with this problem.
i have the following situation:
4 workstations SUNs:
SunOS porsche 5.8 Generic_117350-18 sun4u sparc SUNW,Sun-Blade-100
SunOS jaguar 5.8 Generic_108528-18 sun4u sparc SUNW,Sun-Blade-100
SunOS mercedes 5.8 Generic_117350-18 sun4u sparc... (2 Replies)
Discussion started by: dougpss
2 Replies
2. Shell Programming and Scripting
Hi friends,
i have written one small script named as "size.sh".....
while running its giving
syntax error at line no 2: 'str=$' unexpected.
How to run this file ??? please help me.
file content is :
-----------------------------
#!/bin/sh
str=$( df -k | grep /usr/local)... (14 Replies)
Discussion started by: samfrance
14 Replies
3. UNIX for Dummies Questions & Answers
hey,
i'm trying to run several processes due 2 loops :
the code is:
cd ${TIBCO_HOME}/tra/domain/${DOMAIN}/application/
for app_name in ls *
do
echo $app_name
if && && ;
then
exit
else
echo $app_name
cd $app_name
pwd
for ps_name in ls *.sh
do
echo... (2 Replies)
Discussion started by: ohadr
2 Replies
4. Shell Programming and Scripting
Hi All,
I am running a script which is present on remote machine using ssh command.
the remote script is failing when try to load a property file. It says file does not exist.
Any idea what should be the problem for this.
Thanks
Supriya. (7 Replies)
Discussion started by: supriyabv
7 Replies
5. Shell Programming and Scripting
Hi,
I have following K script, that is in rc0.d directory to be run on shutdown. It's linked using the 'ln' command to init.d.Can anyone tell me as to why it's not running, or if i have incorrect syntax?I get:
"test: argument expected
type=uname -p
+ "
When running it with sh -x
... (8 Replies)
Discussion started by: darrlaw
8 Replies
6. Shell Programming and Scripting
Hi,
I'm trying to run a simple shell script whose contents are pasted below.
#!/usr/bin/ksh
echo $PATH
performbuild
{
echo "Inside performBuild function"
}
echo "Main Shell started"
performbuild
echo "Main Shell ended"
DV> ls -ltr
total 48
-rwxr-xr-x 1 pb5377 it-ibm ... (5 Replies)
Discussion started by: blp_18
5 Replies
7. Shell Programming and Scripting
I am trying to use the CRON utility in Fedora 11 & CentOS...
I intend to run a script which pops up a warning message every hour and i made the following entry using "CRONTAB -e "
* * * * * sh /bin/myscript.sh
But this does not seem to be running.
Another thing to note is that,... (4 Replies)
Discussion started by: Vabiosis
4 Replies
8. Shell Programming and Scripting
Hi all,
I have a script that calls another program/script, xxx, to run in the background. Supposedly this program at most should finish within five (5) minutes so after five (5) minutes, I run some other steps to run the script into completion.
My problem is sometimes the program takes... (5 Replies)
Discussion started by: newbie_01
5 Replies
9. Shell Programming and Scripting
Hi all,
Running follow command on terminal;
$ glance -T cloudlive -I ubuntu -K ubuntu123 -N \
http://127.0.0.1:5000/v2.0/OpenX add name="cirros" is_public=true \
container_format=ovf disk_format=raw < \
/srv/cirros-0.3.0-x86_64-disk.img
It works without problem.
Putting it on a... (5 Replies)
Discussion started by: satimis
5 Replies
10. Solaris
Hi guys!
I created a backup script that works fine when I run manually, but when I put a crontab job to execute it the result are not the expected. (not a time problem).
Here is my script:
bash-3.00# cat /bk_tool/backup2.sh
#!/usr/bin/csh
clear
set DIR_HOST='SCP08'
... (3 Replies)
Discussion started by: andredemartini
3 Replies
LEARN ABOUT CENTOS
shell-quote
SHELL-QUOTE(1) User Contributed Perl Documentation SHELL-QUOTE(1)
NAME
shell-quote - quote arguments for safe use, unmodified in a shell command
SYNOPSIS
shell-quote [switch]... arg...
DESCRIPTION
shell-quote lets you pass arbitrary strings through the shell so that they won't be changed by the shell. This lets you process commands
or files with embedded white space or shell globbing characters safely. Here are a few examples.
EXAMPLES
ssh preserving args
When running a remote command with ssh, ssh doesn't preserve the separate arguments it receives. It just joins them with spaces and
passes them to "$SHELL -c". This doesn't work as intended:
ssh host touch 'hi there' # fails
It creates 2 files, hi and there. Instead, do this:
cmd=`shell-quote touch 'hi there'`
ssh host "$cmd"
This gives you just 1 file, hi there.
process find output
It's not ordinarily possible to process an arbitrary list of files output by find with a shell script. Anything you put in $IFS to
split up the output could legitimately be in a file's name. Here's how you can do it using shell-quote:
eval set -- `find -type f -print0 | xargs -0 shell-quote --`
debug shell scripts
shell-quote is better than echo for debugging shell scripts.
debug() {
[ -z "$debug" ] || shell-quote "debug:" "$@"
}
With echo you can't tell the difference between "debug 'foo bar'" and "debug foo bar", but with shell-quote you can.
save a command for later
shell-quote can be used to build up a shell command to run later. Say you want the user to be able to give you switches for a command
you're going to run. If you don't want the switches to be re-evaluated by the shell (which is usually a good idea, else there are
things the user can't pass through), you can do something like this:
user_switches=
while [ $# != 0 ]
do
case x$1 in
x--pass-through)
[ $# -gt 1 ] || die "need an argument for $1"
user_switches="$user_switches "`shell-quote -- "$2"`
shift;;
# process other switches
esac
shift
done
# later
eval "shell-quote some-command $user_switches my args"
OPTIONS
--debug
Turn debugging on.
--help
Show the usage message and die.
--version
Show the version number and exit.
AVAILABILITY
The code is licensed under the GNU GPL. Check http://www.argon.org/~roderick/ or CPAN for updated versions.
AUTHOR
Roderick Schertler <roderick@argon.org>
perl v5.16.3 2010-06-11 SHELL-QUOTE(1)