Skip to main content
added 4 characters in body
Source Link
abc
  • 218
  • 2
  • 6

In the shell script ; it becomes the variable name $1 . The second word becomes the variable name $2 and so on .

cat <<EOF><< myscript'EOF' > test
echo "First arg: $1"
echo "Second arg: $2"
echo "List of all arg: $@"
EOF
sh myscripttest hello world

More maybe found in the shell (sh) manual at http://heirloom.sourceforge.net/sh/sh.1.html

In the shell script ; it becomes the variable name $1 . The second word becomes the variable name $2 and so on .

cat <<EOF> myscript
echo "First arg: $1"
echo "Second arg: $2"
echo "List of all arg: $@"
EOF
sh myscript hello world

More maybe found in the shell (sh) manual at http://heirloom.sourceforge.net/sh/sh.1.html

In the shell script ; it becomes the variable name $1 . The second word becomes the variable name $2 and so on .

cat << 'EOF' > test
echo "First arg: $1"
echo "Second arg: $2"
echo "List of all arg: $@"
EOF
sh test hello world

More maybe found in the shell (sh) manual at http://heirloom.sourceforge.net/sh/sh.1.html

added 123 characters in body
Source Link
abc
  • 218
  • 2
  • 6

In the shell script ; it becomes the variable name $1 . The second word becomes the variable name $2 and so on .

cat <<EOF> myscript
echo "First arg: $1"
echo "Second arg: $2"
echo "List of all arg: $@"
EOF
sh myscript hello world

More maybe found in the shell (sh) manual at http://heirloom.sourceforge.net/sh/sh.1.html

In the shell script ; it becomes the variable name $1 . The second word becomes the variable name $2 and so on .

cat <<EOF> myscript
echo "First arg: $1"
echo "Second arg: $2"
EOF
sh myscript hello world

In the shell script ; it becomes the variable name $1 . The second word becomes the variable name $2 and so on .

cat <<EOF> myscript
echo "First arg: $1"
echo "Second arg: $2"
echo "List of all arg: $@"
EOF
sh myscript hello world

More maybe found in the shell (sh) manual at http://heirloom.sourceforge.net/sh/sh.1.html

Source Link
abc
  • 218
  • 2
  • 6

In the shell script ; it becomes the variable name $1 . The second word becomes the variable name $2 and so on .

cat <<EOF> myscript
echo "First arg: $1"
echo "Second arg: $2"
EOF
sh myscript hello world