Hi All,
How can I exec a script using awk(system). Firsly I create a file with the nessary info, chmod 755 and then exec the script.
awk -F " " '{
split($1,a,".")
STAC=a[1]
datatype=a[2]
DSN=a[3]
TSN=a[4]
D_T=$5" "$6
cmd="Timestamp " D_T "
cmd | getline TIME; close(cmd);
printf "Jack %s %s \n",TSN,STAC > $1
system("/usr/bin/chmod 777 " $1)
{ if (system("$1 ") != 0) {
printf("Failed\n");
} else {
printf("Done\n")}}
}' Filename_txt
Many Thanks
Chris
How can I exec a script using awk(system). Firsly I create a file with the nessary info, chmod 755 and then exec the script.
awk -F " " '{
split($1,a,".")
STAC=a[1]
datatype=a[2]
DSN=a[3]
TSN=a[4]
D_T=$5" "$6
cmd="Timestamp " D_T "
cmd | getline TIME; close(cmd);
printf "Jack %s %s \n",TSN,STAC > $1
system("/usr/bin/chmod 777 " $1)
{ if (system("$1 ") != 0) {
printf("Failed\n");
} else {
printf("Done\n")}}
}' Filename_txt
Many Thanks
Chris