Questions tagged [positional-parameter]

75 questions
0
votes
1 answer

Bash get variable at shell execution

There is a method to get a variable with the bash execution command? Example: ./exec.sh var1 var2 or with arguments ./exec.sh -x var1 -y var2 I looked for "Get variable at bash execution" but nothing.
Northumber
  • 175
  • 1
  • 2
  • 14
0
votes
1 answer

Typeerror missing the positional arguments

I want to open the csv file and reverse it while I read the code, replace the date with the consecutive numbers and leave it there. def s(a, b): try: if a==str(userInput) and b==int(userInput): for line in…
0
votes
1 answer

Positional before Named argument list parsing

How would you do that in the parser combinators def namedAfterPos[P, N](pos: Parser[P], nmd: Parser[N], sep: Parser[_] = ",") = ??? List("a", "a,a,a", "a,a,a=b,a=b", "a=b, a=b") map (_ parseWith namedAfterPos("a", "a=b")) map {case Success(res, _)…
0
votes
0 answers

Is there another paradigm besides positional arguments, keyword arguments and type-based method/function overloading?

I've read someone on the internet pondering parameter negotiation. I could also imagine some experience-based inference. For example: a method has two parameters of the same type. Positional arguments: based on the sequence of listing the…
tuexss
  • 101
  • 1
  • 11
0
votes
1 answer

bash script to cd to value it reads from configuration file

I am having trouble with a bash script that is launched as a subshell from another shell. The script is installed in a number of different environments each of which have a variety of local-specific values set in a single config file per…
Fred Zimmerman
  • 1,019
  • 2
  • 9
  • 26
0
votes
1 answer

trouble understanding difference in 'find' output for bash using prompt, positional parameters

So I am trying to understand the difference between two results in Bash to further my understanding of positional parameters: $ find ./*.md one.md two.md three.md four.md and: $ ./findall.sh ./*.md one.md where findall.sh is: #!/usr/bin/env…
0
votes
1 answer

Best Way To Carry Positional Parameter From Script To Subscript In Linux

I have setup a Crontab that executes the "find" command which then executes a shell script on each of it's arguments. At the very end of the first shell script is another "find" command which executes another shell script. My question: is there a…
0
votes
2 answers

Failed to add Date to Access database

Having a bit of trouble adding birthday data to an Access database. I have tried running the code without 'birthday' getting in the way and it works then. As per my research, 'DBDate' also takes in milliseconds into account and I've tried saving the…
Raj Saha
  • 39
  • 1
  • 6
-1
votes
2 answers

Why positional arguments need to be specified before keyword arguments in Python?

I understand passing positional arguments first and then passing the keyword arguments is a rule in python. And that's why these are wrong: def fun(x,y): print(x,y) fun3(y=4,3) SyntaxError: positional argument follows keyword argument and…
-1
votes
4 answers

TypeError: get() missing 1 required positional argument: 'url' error using GeckoDriver and Firefox through Selenium and Python

Executing below code in pycharm. from selenium import webdriver browser = webdriver.Firefox browser.get('https://www.google.com') Error: TypeError: get() missing 1 required positional argument: 'url' How can I solve the error?
-1
votes
1 answer

Why is the positional parameter still present after sourcing the script?

I am sourcing a script and the value of the positional parameter is reflecting even after the script is sourced. $ echo $1 $ . $SCRIPTS_DIR/xeye.sh ryadqa Done $ echo $1 ryadqa
summithere
  • 11
  • 4
-1
votes
1 answer

How can I rearrange the outputfile in order to obtain the numbers in lane and separated by a blank space?

Here's my script. It takes only 4 positional parameters. The output should be all the positional parameters, the number of characters that each one has and the first character of each one. #!/bin/bash rm -r param.out declare -i cont cont=$# if […
Pol
  • 1
-1
votes
2 answers

Recursion does not work with positional arguments

I am trying to do multiplication recursion (multiplying all the values of a container) in Python. The function receives the elements of the list as positional argument(*n). On execution I receive the error saying "Maximum recursion depth reached".…
thunde47
  • 21
  • 4
-1
votes
1 answer

Python parameter list with single argument

When testing Python parameter list with a single argument, I found some weird behavior with print. >>> def hi(*x): ... print(x) ... >>> hi() () >>> hi(1,2) (1, 2) >>> hi(1) (1,) Could any one explain to me what the last comma mean in hi(1)'s…
-3
votes
2 answers

How to clear postional parameters array?

This post age makes it irrelevant and not worth blocking me from more posts. keeping It makes this site statistical data collection and NOT supporting technical issues.
Jan Hus
  • 135
  • 7
1 2 3 4
5