คุณสามารถส่งผ่านข้อโต้แย้งไปยังสคริปต์ gnuplot ตั้งแต่รุ่น 5.0 -cกับธง ข้อโต้แย้งเหล่านี้จะเข้าถึงได้ผ่านตัวแปรARG0ไปARG9, ARG0เป็นสคริปต์และARG1การARG9ตัวแปรสตริง ARGCจำนวนของการขัดแย้งจะได้รับจาก
ตัวอย่างเช่นสคริปต์ต่อไปนี้ ("script.gp")
#!/usr/local/bin/gnuplot --persist
THIRD=ARG3
print "script name : ", ARG0
print "first argument : ", ARG1
print "third argument : ", THIRD
print "number of arguments: ", ARGC
สามารถเรียกว่าเป็น:
$ gnuplot -c script.gp one two three four five
script name : script.gp
first argument : one
third argument : three
number of arguments: 5
หรือภายใน gnuplot เป็น
gnuplot> call 'script.gp' one two three four five
script name : script.gp
first argument : one
third argument : three
number of arguments: 5
ใน gnuplot 4.6.6 และก่อนหน้านี้มีcallกลไกที่มีไวยากรณ์ที่แตกต่างกัน (เลิกใช้แล้ว) ข้อโต้แย้งมีการเข้าถึงผ่าน$#, $0, ... $9, ตัวอย่างเช่นสคริปต์เดียวกันด้านบนมีลักษณะดังนี้:
#!/usr/bin/gnuplot --persist
THIRD="$2"
print "first argument : ", "$0"
print "second argument : ", "$1"
print "third argument : ", THIRD
print "number of arguments: ", "$#"
และมันถูกเรียกภายใน gnuplot ว่า (จำไว้เวอร์ชัน <4.6.6)
gnuplot> call 'script4.gp' one two three four five
first argument : one
second argument : two
third argument : three
number of arguments: 5
โปรดสังเกตว่าไม่มีตัวแปรสำหรับชื่อสคริปต์ดังนั้นจึง$0เป็นอาร์กิวเมนต์แรกและตัวแปรจะถูกเรียกภายในเครื่องหมายคำพูด ไม่มีวิธีที่จะใช้สิ่งนี้โดยตรงจากบรรทัดคำสั่งเพียงใช้กลอุบายตามที่แนะนำโดย @ con-fu-se
ifการจัดหาค่าเริ่มต้นif ! exists("filename") filename='default.data'