shell script help please

#!/bin/bash

x = `find / -type f -inum +1 -mtime -30 -exec ls -lu {} \; 2>/dev/null | awk '{print $6,$7,$8}'`

y = `find / -type f -inum +1 -mtime -30 -exec ls -lc {} \; 2>/dev/null | awk '{print $6,$7,$8}'`

z = `find / -type f -inum +1 -mtime -30 -exec ls -lc {} \; 2>/dev/null | awk '{print $9}'`

echo "$x $y $z"

i don't understand why i do not get an output.
when i execute these commands in the shell, they work perfectly but when i assign them a variable and do echo to print the variables, no output when i execute the shell. the shell waits for command to end.

You cannot have variable[space] = [space] `code here `

Remove all spaces around the =

a=`find / -type f -inum +1 -mtime -30 -exec ls -lu {} \; 2>/dev/null | awk '{print $6,$7,$8}'`

b=`find / -type f -inum +1 -mtime -30 -exec ls -lc {} \; 2>/dev/null | awk '{print $6,$7,$8}'`

c=`find / -type f -inum +1 -mtime -30 -exec ls -lc {} \; 2>/dev/null | awk '{print $9}'`

removed the spaces in between, yet no output.
i execute the script but need to do a ctrl + c to escape.

---------- Post updated at 08:22 PM ---------- Previous update was at 08:19 PM ----------

the commands are working seperately of the script so i know it's not a syntax error with the commands at least.

---------- Post updated at 09:22 PM ---------- Previous update was at 08:22 PM ----------

works on a smaller subdirectory but not root directory. perplexed as to why.

Based on the number of volumes/files on your server, find can take a substantial amount of time to search something from /.

Time one of the find commands separately and multiply that time by 3. That is the amount of time your script will probably take before giving any output at all.

Back to first principles.

The commands as posted will not produce any output. They will just put concatonated values into the three environment variables $a $b $c . There is a limited size to an environment variable.
Also, there is no point to the "-inum +1" cause.

What are you trying to do, and what do you want the output to look like?

hey methyl,
trying to look for regular files, with one or more inodes, modified within the last 30 days.
variable a would display time last accessed, b would display time last modified and c would display full path of the file.
could i have done without the-inum +1? thanks.

It's a waste of time to traverse the file tree three times when you only need to do it once. You didn't say which flavour of Unix, but if you have a stat command installed, something like this produces 5 columns of output for each file that matches your find criteria and only one pass across the filesystem (in terms of find) is needed. Output, left to right, is date/time of last access, date/time of last modificaton, and file name.

find / -type f -mtime -30 | xargs stat -c "%x %y %n"|sed -E 's/[.][0-9]+//g; s/ -[0-9]+//g'

The sed just strips decimals from the time and the timezone offset.

Depending on what tools you have installed, the -E option to sed might need to be -R. On a FreeBSD system the stat command will be something like this:

 xargs stat -f "%Sa %Sm %N"

As for whether or not to use -inum...
The way I read the man page for find, inum is used to match a specific inum. As a file can only have one inum using a +1 construct makes no sense (at least not to me).

A regular file will have one inode within the filesystem. That inode has a unique number within the filesystem. That inode number is the number referred to in the "-inum" parameter to "find". It is the same number you get with the "-i" switch to "ls". When there is a hard link to a file within that filesystem it is possible to have more than one name for the same inode number.
The "-inum +1" switch is pointless in this context.

Without knowing what Operating System and Shell you have it is hard to propose a solution. I see that "agama" has posted a neat solution with the "stat" command which is available on some Operating Systems.