Category : bash

So I have a python program that reads a config file like this: import argparse parser = argparse.ArgumentParser() parser.add_argument(‘-c’, ‘–config’, type=str, help=’config file’, required=True) args = parser.parse_args() cfg_filename = args.config I want to be able to autocomplete paths in bash. For example, suppose the above program is called main.py and there is a config file ..

Read more

I am trying to a script run.sh using python subprocess The script creates a csv file and a state.json file This is the script(works fine when i run it from terminal) : #!/bin/bash export GOOGLE_APPLICATION_CREDENTIALS="/home/anti/Documents/bq_s3/BQ/bin/client_secret.json" /home/anti/Documents/bq_s3/BQ/bin/tap-bigquery -c /home/anti/Documents/bq_s3/BQ/bin/tap_config.json –catalog /home/anti/Documents/bq_s3/BQ/bin/catalog.json –start_datetime ‘2013-01-01T00:00:00Z’ –end_datetime ‘2013-01-02T00:00:00Z’ | /home/anti/Documents/bq_s3/targetcsv/targetcsv/bin/target-csv –config /home/anti/Documents/bq_s3/targetcsv/targetcsv/bin/target_config.json > /home/anti/Documents/bq_s3/state.json But when i try to ..

Read more

I am trying to a script run.sh using python subprocess The script creates a csv file and a state.json file This is the script(works fine when i run it from terminal) : #!/bin/bash export GOOGLE_APPLICATION_CREDENTIALS="/home/anti/Documents/bq_s3/BQ/bin/client_secret.json" /home/anti/Documents/bq_s3/BQ/bin/tap-bigquery -c /home/anti/Documents/bq_s3/BQ/bin/tap_config.json –catalog /home/anti/Documents/bq_s3/BQ/bin/catalog.json –start_datetime ‘2013-01-01T00:00:00Z’ –end_datetime ‘2013-01-02T00:00:00Z’ | /home/anti/Documents/bq_s3/targetcsv/targetcsv/bin/target-csv –config /home/anti/Documents/bq_s3/targetcsv/targetcsv/bin/target_config.json > /home/anti/Documents/bq_s3/state.json But when i try to ..

Read more

Stuck with the below two points. First line contains an integer N. Second line contains N space separated integers in the decreasing order of their occurrence in the array. Output must be printed in a single line Sample Input 1 5 1 2 2 1 6 Sample Output 1 2 1 6 I tried for ..

Read more