Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash forward argv to command

# in r.sh
echo "params only 2    : ${@:2:1}"
echo "params 2 and 3   : ${@:2:2}"
echo "params all from 2: ${@:2:99}"
echo "params all from 2: ${@:2}"

# run it:
$ chmod u+x r.sh
$ ./r.sh 1 2 3 4 5 6 7 8 9 10

# result:
params only 2    : 2
params 2 and 3   : 2 3
params all from 2: 2 3 4 5 6 7 8 9 10
params all from 2: 2 3 4 5 6 7 8 9 10
Comment

PREVIOUS NEXT
Code Example
Shell :: bash numbering even filename 
Shell :: fatal: unable to create thread: fatal: fetch-pack: invalid index-pack output 
Shell :: git credential.helper does not store username password 
Shell :: apache show connections 
Shell :: install docker ce on centos 
Shell :: delete all empty files and folders in terminal 
Shell :: E: Unable to locate package rvm 
Shell :: Make sure /usr/local/bin is in your PATH environment variable. 
Shell :: disbale knopwob dunst 
Shell :: grant user root permissions oracle linux 
Shell :: mariadb references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them 
Shell :: curl cookie get 
Shell :: connect different volumes docker container 
Shell :: dokcer not working 
Shell :: linux remove non empty directory 
Shell :: bash file properties 
Shell :: git ignore more then 10MB 
Shell :: how to install mongodb database in ubuntu version 
Shell :: variable replacement bash zero padding 
Shell :: how to generate ssh keys for git 
Shell :: install scrcpy in ubuntu 
Shell :: linux echo variable 
Shell :: top running port 
Shell :: turn on wiregurad ubuntu 
Shell :: gnome terminator 
Shell :: how to checkout a remote branch in git 
Shell :: unmount linux 
Shell :: Running a local script on a remote machine (or remote on local) 
Shell :: what is vi in linux 
Shell :: git stash in file 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =