Execute python script while open terminal

The fish-shell was new to me, so I read the documentation – something I really recommend. Look for the title “Initialisation Files“: http://fishshell.com/docs/current/index.html#initialization So it looked like you call your python scripts from ~/.config/fish/config.fish So I installed fish on my Macbook and I had to create the config.fish file. In that I just placed: ~/gash.py … Read more

how to get the time after two minutes [closed]

To get the date-string in bash: echo “Current: ” $(date +”%Y”-“%m”-“%d”T”%H”-“%M”-“%S”) echo “+2 min : ” $(date –date=”@$(($(date +%s)+120))” +”%Y”-“%m”-“%d”T”%H”-“%M”-“%S”) prints Current: 2014-09-10T15-58-15 +2 min : 2014-09-10T16-00-15 Read the time from string and print +2min string str=”2014-09-10T15-58-15″ new=$(date –date=”@$(($( IFS=”-T” read y m d H M S <<< “$str”;date –date=”$y-$m-${d}T$H:$M:$S” +%s )+120))” +”%Y”-“%m”-“%d”T”%H”-“%M”-“%S”) echo “From … Read more

replacing a placeholder in a html file with 1-n specific values defined in a config.json using shellscript [closed]

we cannot use any 3rd party tools which are not usually present on systems Given that we don’t know what “systems” you’re using, this isn’t a very useful restriction to tell us about. Perl has several JSON parsers available and since Perl 5.14 (which was released in May 2011) one of them (JSON::PP) has been … Read more

Enhancement of unix script [closed]

Bash is not very performant doing loops. Since you tagged the question python, python should be ok? def data_mask(col_val): mod = len(col_val) + sum(map(ord, col_val)) % 10 result = “” for i, ch in enumerate(col_val, mod + 1): absnum = abs(ord(ch) – i) if ‘A’ <= ch <= ‘Z’: ch = chr(ord(‘A’) + absnum % … Read more