I am running the following system command:
df -h | grep /db2/$DB2DBDFT/sapdata
in my script and assigning it to a variable which I then later print to a file and the file is then put in an email.
When I run the command at the prompt I get this:
df -h | grep /db2/$DB2DBDFT/sapdata 30G 26G 2.1G 93% /db2/BXP/sapdata1 30G 11G 18G 37% /db2/BXP/sapdata2 30G 23G 5.9G 80% /db2/BXP/sapdata3 30G 6.0G 23G 22% /db2/BXP/sapdata4 2.0G 36M 1.9G 2% /db2/BXP/sapdatat 2.0G 36M 1.9G 2% /db2/BXP/sapdatat2
When I run the script I get this error:
sh: line 82: printf: `/': invalid format character
The line number is wrong for one thing but that is besides the point. Here is the code:
print OUT "Current File System Usage:\n"; print OUT "Filesystem Size Used Avail Use Mounted on\n"; $rc = `df -h | grep /db2/$DB2DBDFT/sapdata`; print OUT "$rc\n";
I think it has to do with the / in the "filesystem name" column or the "Mounted on" column. The weird thing is that I don't have this problem on Unix.
I appreciate any suggestions on how to handle this.
In reply to print question by bp4a
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |