sandy1028 Posted April 3, 2012 Share Posted April 3, 2012 Please tell me how to call, getimagesize() in exec command. http://www.example.com/images!/logos/ps_logo2.png I am using the linux enviroment. If the uRL has "!" symbol, it prints event not found. Please tell me how to avoid this. Quote Link to comment https://forums.phpfreaks.com/topic/260256-php-commad-using-shell/ Share on other sites More sharing options...
trq Posted April 3, 2012 Share Posted April 3, 2012 Your going to need to be clearer with your description. You can write a script that calles getimagesize() and then call that script from the shell. But getimagesize() isn't a shell commend so it cannot be called directly. Quote Link to comment https://forums.phpfreaks.com/topic/260256-php-commad-using-shell/#findComment-1333913 Share on other sites More sharing options...
sandy1028 Posted April 4, 2012 Author Share Posted April 4, 2012 When ran the below line on command prompt, php -r "print_r(getimagesize('http://www.example.com/images!/logos/ps_logo2.png'));" -bash: !/logos/ps_logo2.png': event not found To avoid this wrapped in the sahll script. #!/bin/bash php -r "print_r(getimagesize('http://www.example.com/images!/logos/ps_logo2.png'));" can you please tell me, how can we avoid this in php script. Quote Link to comment https://forums.phpfreaks.com/topic/260256-php-commad-using-shell/#findComment-1334219 Share on other sites More sharing options...
kicken Posted April 4, 2012 Share Posted April 4, 2012 You can just reverse the quotes so you encase the php code in single quotes. php -r 'print_r(getimagesize("http://www.example.com/images!/logos/ps_logo2.png"));' Then bash won't interpret the ! as special character. Quote Link to comment https://forums.phpfreaks.com/topic/260256-php-commad-using-shell/#findComment-1334308 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.