If you want to shift the positional parameters to the left, which command would you use?
- shift
- mv
- leftshift
- change
The correct answer is a) shift. The 'shift' command is used in shell scripts to shift the positional parameters to the left. When you use 'shift' without an argument, it discards the value of $1 and shifts the rest of the positional parameters, updating $1 to the previous $2, $2 to the previous $3, and so on. This is useful when processing command-line arguments.
Loading...
Related Quiz
- Which command in Linux is commonly used to manage and update user passwords?
- In the context of VPNs in Linux, the _________ protocol is known for its speed and efficiency but may not be as secure as other options.
- What is the primary difference between ext4 and ext3 file systems?
- Which SSH configuration parameter specifies the maximum number of authentication attempts allowed per connection?
- The _________ utility in Samba is used to manage user accounts and passwords.