nixCraft Linux / UNIX Newsletter

Link to [RSS/Feed] nixCraft: Linux Tips, Hacks, Tutorials, And Ideas In Blog Format

Bash get exit code of command on a Linux / Unix

Posted: 03 Dec 2018 12:15 PM PST

I am a new Linux system user. How do I get the exit code of a command? How do I get the exit code of Linux or Unix shell command and store it into a shell variable?

The post Bash get exit code of command on a Linux / Unix appeared first on nixCraft.

Bash read file names from a text file and take action

Posted: 03 Dec 2018 11:13 AM PST

I need to read a list of file names from a text file named input.txt and take action each file name. How do I read file names from a text file and say run /bin/foo command on each file? How do I read filenames from a text file and take certain action on those files?

The post Bash read file names from a text file and take action appeared first on nixCraft.