Can't rotate in pdftk

Bash
I am following the online instructions and trying to rotate all pages of a PDFs 90 degrees clockwise like so pdftk in.pdf cat 1E output out.pdf But...
2 years ago

in bash shell: extract part of the output of a command and output to file

Bash
Say I run "mount" on Bash, I get something like this: --]$mount /dev/disk1 on / (journaled) map -hosts on /net (autofs, nosuid, automounted, nobrowse...
2 years ago

Obtaining file names from directory in Bash

Bash
I am trying to create a zsh script to test my project. The teacher supplied us with some input files and expected output files. I need to diff the out...
2 years ago

How to stripoff the string after space, slash (/), greater than (>),dot(.) in shell

Bash
I need to strip-off the data which comes after space , slash /, greater than >, dot .. I only need to display the part before the space, slash, dot...
2 years ago

Bash: How to break a string into array elements according to a delimiter

Bash
I've read and tried different approaches (e.g IFS, AWK, SED) on how to tokenize this kind of string: data|date|token1|token2|process_job.sh Y I wan...
2 years ago

Using brace expansion in if statement

Bash
Let's say I've got a list with file names in it with date. I want to do something on files with extension png or jpg of a specific date. I've got the ...
2 years ago

Vim: introduce a "light mode", when not all plugins are loaded

Bash
My Vim config includes plugins that try to handle current project, build tags, etc. This is quite useful for my daily programming in Vim, but it's jus...
2 years ago

Restart a python script after x amount of time

Bash
I have a script that records audio for 15 sec, then kills itself( this needs to happen since that is the only way the recording stops using gstreamer)...
2 years ago

Iterating over lines in a file with "for" in shell never matching target

Bash
i wrote a shell script as you can see followed. The script reads all line which in .dat file and writes screen matching words according to specified p...
2 years ago

How to set the process name of a shell script?

Bash
Is there any way to set the process name of a shell script? This is needed for killing this script with the killall command.
2 years ago

Can BASH or/with AWK be used to extract multiple non-greedy regex-matching parts from a line?

Bash
If I have a file like this: abc defghaijkb,mnaobpqa pbqaaa qrs - a .. b ... cde Can awk and/or bash extract all the parts which start with a and ...
2 years ago

How to extract multiple non-greedy regex-matching parts from a line?

Bash
If I have a file like this: abc defghaijkb,mnaobpqa pbqaaa qrs - a .. b ... cde How to extract all the parts which start with a and end with b (I...
2 years ago

Is there a "goto" statement in bash?

Bash
Is there a "goto" statement in bash ? I know It is considered bad practice, but I need specifically "goto".
2 years ago

How do I pass an empty string with double quotes to a bash script?

Bash
I'm trying to write a script that will accept as additional arguments on the command line an empty string with double quotes. I want the script to pas...
2 years ago

Execute shell script in remote machine using ssh command with config file

Bash
I want to execute a shell script in remote machine and i achieved this using the below command, ssh user@remote_machine "bash -s" < /usr/test.sh ...
2 years ago

cygwin bash shell variables lost when script sourced from within a function

Bash
I've encountered a strange (to me) problem in cygwin bash version 4.3.42(4). Shell variables that are declared in a called script do not persist in th...
2 years ago

Bash shell variables lost when script sourced from within a function

Bash
I've encountered a strange (to me) problem in Cygwin bash version 4.3.42(4). Shell variables that are declared in a called script do not persist in th...
2 years ago

Insert string in file with sed

Bash
I have a file tmp with the following content. <port>1554</port><tt>file</tt> I want to insert a string with sed command. I ...
2 years ago

How to execute mongo commands through shell scripts?

Bash
I want to execute mongo commands in shell script. I tried following way test.sh #!/bin/sh mongo myDbName db.mycollection.findOne() show collectio...
2 years ago

How to execute ssconvert command using subprocess in python

Bash
I want to execute the following command ssconvert /data/sam.xls,/data/test.csv I have tried p = subprocess.Popen(["ssconvert", '/data/sam.xls','...
2 years ago