Aquireing the entire string sent to the shell for execution

Posted by user294567 on Stack Overflow See other posts from Stack Overflow or by user294567
Published on 2010-03-16T08:40:33Z Indexed on 2010/03/16 8:56 UTC
Read the original article Hit count: 181

Filed under:

I have a bash script that looks like this (called job_result.sh):

#!/bin/bash
$* && zenity --title "Job result" --info --text "SUCSESS: Job '$*'completed" && while pidof zenity > /dev/null; do /usr/bin/wmctrl -a "Job Result" && sleep 2; done

When i execute it with:

$ ./job_result.sh echo "arf" && sleep 10

I want the following to happen:

$ echo "arf" && sleep 10 && zenity --title "Job result" --info --text "SUCSESS: Job '$*'completed" && while pidof zenity > /dev/null; do /usr/bin/wmctrl -a "Job Result" && sleep 2; done

But it seems the following is happening:

$ echo "arf" && zenity --title "Job result" --info --text "SUCSESS: Job '$*'completed" && while pidof zenity > /dev/null; do /usr/bin/wmctrl -a "Job Result" && sleep 2; done

Question: How do i get hold of the entire shell argument? And not just the part until &&?

© Stack Overflow or respective owner

Related posts about bash