I have this line in a sh script:
bdf | grep /var/opt/vgdb | tr -s " " | cut -f4,6 -d" " | awk '{print $2" "$1}' > vgdb_free_space.txt
if I run that line in the shell it works fine
but when I ran the script got this error:
add_database_files.sh: line 83: bdf: command not found
also I tried create a script with only that line:
#!/usr/bin/ksh -> also I tried with sh :s
bdf | grep /var/opt/vgdb | tr -s " " | cut -f4,6 -d" " | awk '{print $2" "$1}' > vgdb_free_space.txt
with the same error
oracle@etlx1103.eu.pg.com:SID=dummy101> sh csh.sh
csh.sh: line 2: bdf: command not found
oracle@etlx1103.eu.pg.com:SID=dummy101> ll vgdb_free_space.txt
-rw-r----- 1 oracle dba 0 May 18 00:48 vgdb_free_space.txt
/var/opt/gold/scripts
oracle@etlx1103.eu.pg.com:SID=dummy101> cat vgdb_free_space.txt
/var/opt/gold/scripts
I ran manually and it works...
oracle@etlx1103.eu.pg.com:SID=dummy101> bdf | grep /var/opt/vgdb | tr -s " " | cut -f4,6 -d" " | awk '{print $2" "$1}' > vgdb_free_space.txt
/var/opt/gold/scripts
oracle@etlx1103.eu.pg.com:SID=dummy101> cat vgdb_free_space.txt
/var/opt/vgdb01/u01 21470524
/var/opt/vgdb02/u01 25876108
does someone knows how to do that in linux?