I‘m writing a bash wrapper script that will pass arguments to the command. I need to find out the last argument if I call the wrapper as follows:
./wrapper -a -b –longarg=foo thisfilename.txt
./wrapper -a -b thisfilename.txt
./wrapper -a –next=true thisfilename.txt
=> $@ is all of them.
=> $0 is script name.
=> $1 is first arg.
I want thisfilename.txt stored in a shell variable called $last. How do I find the last argument passed to a shell script written in bash or ksh under Unix like operating systems?
‘ve received a file called date.tar.gz. How do I open/extract/unpack a tar.gz file on Linux or Unix like operating systems using shell prompt?
y router configured by ISP tech and it is set to get DNS server address automatically from upstream. Is there is a way to find out the IP address of the dns server used by my router which is located at 192.168.1.1? Is there Linux, Unix, Apple OS X, or MS-Windows command that I can use get the same information?
I want to find and edit my xorg.conf file for tweaking and configure it for new settings. The problem is that I’m unable to find the file. According to my research, xorg.conf should in /etc/X11 or /usr/X11R6/lib/X11/ directory. I found directories but not the file in directories. How do I find the xorg.conf under Unix or Linux like operating systems?
I‘m trying to download an ISO image for Enterprise Linux from RHN or Novell Suse. Both providers have placed ISO images behind paywall. I need to provide authentication credentials before downloading all files. How do I download ISO files using the wget command with user name and password?
I‘ve created the backup server using this tutorial under Redhat and Debian Linux systems. How do I restore files (such as /var/www/html) with rsnapshot backup tool? How do I restore MySQL database dumps with rsnapshot under UNIX or Linux operating systems?