You are not logged in.
Pages: 1
hi to all
how can i use the return of a command executed in a terminal ?
thanks
Last edited by nTia89 (2010-12-30 14:32:34)
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
What do you mean by return? The exit status or the output of a command?
don't drink unwashed fruit juice.
i never make predictions, especially about the future.
Offline
Or do you mean the output?
Offline
If you mean exit code:
echo $?
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
What do you mean by return? The exit status or the output of a command?
this! the exit status: 1,0,-1.....
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
don't drink unwashed fruit juice.
i never make predictions, especially about the future.
Offline
In what language?
Offline
In what language?
bash
thanks very much is what i was searching !
Last edited by nTia89 (2010-12-30 14:17:22)
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
As posted above by .:B:., the exit code of the last run program is stored in the $? variable.
Offline
Pages: 1