Tag Archives: solaris

Bash: Find out the exit codes of all piped commands

Bash: Find out the exit codes of all piped commands

How do I get exit status of process that’s piped to another (for e.g. ‘netstat -tulpn | grep nginx‘) on a Linux or Unix-like system using a bash shell?
Halal Vitamins

Powered by WPeMatico

Linux / Unix: Shell Script Find Out In Which Directory Script File Resides

I need to find out in which directory my bash script resides so that I can read config file called .backup .ignore .target. For example, if my script resides in >/home/foo/script.sh, I need to read /home/foo/.{backup,ignore,target} files. How do I find out the current directory location and shell script directory location in Bash running on Linux or Unix like operating systems?

Read answer to: “Linux / Unix: Shell Script Find Out In Which Directory Script File Resides

Tweet this    Share on Facebook

Powered by WPeMatico

W: TMPDIR is Mounted noexec, Will Not Cache Run Scripts Error and Solution

I mount /tmp with nodev, nosuid, and noexec options to increase the security of my Linux based web server. And, whenever I ran apt-get install or apt-get upgrade command, I am getting the following error: Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-43-generic
Found initrd image: /boot/initrd.img-3.2.0-43-generic
....
ldconfig deferred processing now taking place
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-43-generic W: TMPDIR is mounted noexec, will not cache run scripts. ....
...
How do I fix this problem without compromising security of the data or web-server?

Read answer to: “W: TMPDIR is Mounted noexec, Will Not Cache Run Scripts Error and Solution

Tweet this    Share on Facebook

Powered by WPeMatico

Debian / Ubuntu: apt-get Force Reinstall Package

I am a new Debian Linux v.7.x / Ubuntu Linux LTS user. How do I reinstall a package using apt-get command line?

Read answer to: “Debian / Ubuntu: apt-get Force Reinstall Package

Tweet this    Share on Facebook

Powered by WPeMatico