Strings are typically delimited by quotes, which raises the problem of dealing with strings that include quotes.

learn more… | top users | synonyms

1
vote
2answers
55 views

Define a variable to awk pattern matching from bash

I am trying to grab 100 lines after the text "time: X" with X in {0,40,80,...,200}. Here is what I have so far: #!/bin/bash start=1 end=5 for i in $(seq $start $end);do j=$(($i*40)) awk '/time: ...
0
votes
2answers
272 views

Exclude the output from ssh and only log the error if found

typeset -f | sshpass -e ssh -o StrictHostKeyChecking=no user@${IPADDRESS} " $(cat); IFERROR=$(checkscript); echo "$IFERROR"" > ${SSHTEMPFILE} 2>&1 This line...I can't exclude the ...
0
votes
1answer
23 views

Loop across url with static tokens with Oauth

I need to write a loop where I need to pass a "token" (which is fixed) and a variable (i) in the url. Is there any way I can achieve that? I wrote the following code but it is not working. If I put ...
-1
votes
1answer
61 views

Mutiple commands after sudo in one line

I want to execute multiple commands after a sudo command su - appuser -c "cd /apps/bundle/bundle-client/bin ; export BDL_WEB_USER=not_used ; export BDL_WEB_PASSWORD=not_used ; ./bundle -b ${option....
2
votes
0answers
72 views

Is there a difference between double quoting a variable or a whole line in echo

When you type, for example, echo Variable "$var" is not initialised. and echo "Variable $var is not initialised." the front end result is the exact same (as far as I know, at least). But I was ...
2
votes
0answers
685 views

How to pass multiple commands via pssh and multiple xterms

I'm attempting to open multiple xterms and run a command as an SAP user via sudo using pssh. So far, I'm able to run PSSH to a file of servers with no check for keys, open every xterm in the servers ...
1
vote
0answers
32 views

Passing external parameter to .exe on Windows using winexe from Linux

I am trying to execute a .exe on Windows from Linux using winexe. This exe requires an external parameter (string) to be fed alongwith. With the following command I have succeeded in initialising the ....
1
vote
0answers
38 views

Copy file into all subdirectories that contains a file with certain name

I am trying to copy a features[30,55].R script from my desktop into all the subdirectories that contain a file whose name is DONE. I tried the following command: find . -name "DONE" -exec sh 'cp /...
1
vote
0answers
108 views

How to make tcsh not insert whitespace in a command that spans multiple lines

Bash does not seem to insert whitespace but tcsh does. Tcsh bash-3.2.25$ tcsh -c 'echo $tcsh; echo A\ > B' 6.14.00 A B Bash bash-3.2.25$ bash -c 'echo A\ > B' AB How can I ask tcsh to not insert ...
0
votes
0answers
31 views

Why do konsole expand $VAR inside single quotes in <-e> command line option?

I want to print a string and be sure all $VARs inside it are not expanded to their values. That's why I enclose my text in single quotes. Example: echo '$SHELL';read -sn 1 This command displays ...
0
votes
0answers
43 views

Quoting the pattern in grep and it's still interpreted as an expression?

I have a simple script that I'm using to find CSS definitions in a vanilla bootstrap.css file, then I'm trying to find overridden/duplicate definitions in several other css files where other ...
0
votes
0answers
46 views

How to quote for Maildrop's xfilter?

I am trying to setup up a filter that resolves these "Re: AW: Re: Rif: Subject..." catastrophies. if( /^Subject: (Re: |AW: |Antwort: ){2,}/ || /^Subject: AW:/ || /^Subject: Antwort:/ ) { ...
0
votes
0answers
50 views

swap strings of text inside vim using regex

I am working with a file where I need to swap "string A" and "String B's" locations simultaneously with a regex inside the vim. Here is an example line of code: succ_1st=`grep 'resulted in successful ...
0
votes
0answers
110 views

Why is a here-string command substitution considered as a single line?

I'm experimenting with while read syntax and there is a thing I don't understand. The most basic scenario which reproduces the problem is the following: a bash script a.sh calls another script b.sh ...
0
votes
0answers
71 views

Zsh - Modify File Completion w/ Quotes

I've been using Zsh recently, and when I complete a file name within quotes, the completion adds a space after the completed file name. Interestingly, this does not occur when I complete directory ...