I'm on Solaris 10 and I have tested the following with ksh(88), bash(3.00) and zsh(4.2.1).
The following code doesn't yield any result:
function foo {
echo "Hello World"
}
find somedir -exec foo \;
The find does match several files (as shown by replacing -exec ...
I want to remove certain files using find and -exec. But unlikely bash tells me, that I'm "missing" some argument.
find . -name *.png -exec rm {} /;
what do I miss?
same "missing argument" return for my attempt to rename some files:
find . -name ic_launcher.png -exec mv {} other_name.png /;
Can somebody tell me, what bash does miss, and why this command isn't successful?
Is there a way to use exec, but if exec fails to go on with the script?
Example:
Code:
#!/usr/bin/env bash
exec startx
echo "Starting of X failed"
If startx fails, the echo will be seen on the screen.
I tried all kind of stuff, but guess it ain't of much use to post it here.
I have a bash script, exec.sh like
some command
expect test.exp
continue other command
in the test.exp file, I have a snippet like:
while {[gets $cmds command]>=0} {
send "$command\r"
expect {
"*OK*" {puts $vout $command}
"*fail*" {puts $iout $command}
"*blocked*" { what should I put here????}
}
}
so I want to put something in the curly bracket so that the executio
Hi,
The command output:
Code:
root@laptop:/home/huangyingw/myproject/git/java/algorithm# fw . public
-iname *.java -o -iname *.h -o -iname *.sh
find .
Suppose I have a directory structure as follows
test
test/a
test/b
Now I want to execute a command, such that in the . folder I can execute a command on the basename of the files a and b.
So basically, I want something like this, which I naively tried
find test -type f -exec touch `basename {}` \;
Only, this does not result in empty files a and b in the parent directory.
There is a website with a button, cliking the button should lunch a bash script that suppose to unmount a directory. The button calls functions.inc php script with this function:
function sftmz_release_s3test_connections($bucket_name){
if($bucket_name == 's3test'){
drupal_set_message('Check mount status !
I'm trying to run a command similar to the one below in a bash script.
I was updating my .bash_profile, and unfortunetly I made a few updates and now I am getting:
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
-bash: tar: command not found
-bash: grep: command not found
-bash: cat: command not found
-bash: find: command not found