10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I hope someone can hep with this. I use a skript to send multiline Data to a Monitoring system. Bu I'm not able to use linebreaks or escape sequences.
The skript is simple like that:
#!/bin/bash
var="Erste Zeile \n zweite Zeile \n Dritter Teil"
zabbix_sender -c... (17 Replies)
Discussion started by: mpmichael
17 Replies
2. Debian
Hi Guys
I have another problem I'm trying to solve and hope that some one can help me here.
This is the scenario:
I have a file and I want to add a line on the 3rd line of the file using a bash script. but instead its adding the the bash variable $WEBSITE.
Below is the bash script I'm... (6 Replies)
Discussion started by: linuxjunkie
6 Replies
3. Shell Programming and Scripting
In a bash script I have:
LSCMD="find /project/media/ -mindepth 2 -maxdepth 2 -name \"files*pkg\""
ALL_PACKAGES=$( $LSCMD | sort 2>/dev/null)
But I get nothing returned. It's just all blank. If I run the find command in a terminal, I get dozens of hits.
I figure it's the way how I'm... (3 Replies)
Discussion started by: superbbrr
3 Replies
4. Shell Programming and Scripting
I am trying to use two nested for loops to process some files and then create a new file using both variables in the output file name. I have several files in this naming style:
S1_L3_all_R1.fastq
S1_L3_all_R2.fastq
S1_L4_all_R1.fastq
S1_L4_all_R2.fastq
.
.
S1_L8_all_R1.fastq... (3 Replies)
Discussion started by: aminards
3 Replies
5. UNIX for Dummies Questions & Answers
Here's the input:
alpha, numeric or alphanumeric string ("line 1 string")
numeric string ("line 2 string")
numeric string ("line 3 string")
numeric string ("line 4 string")
...
where
- each numeric string is in a pattern that can be matched with RE but
- there can be any number of... (2 Replies)
Discussion started by: uiop44
2 Replies
6. Shell Programming and Scripting
I have the following line of code:
sed -i "/MatchText/ s/${tgrepLine}/${tNewLine}/" filename.outputfilename.output contains this:
blablabla
PATH=".:/home/root/bin/:/usr/local/bin/"
blablablaVariable ${tgrepLine} contains:
PATH=".:/home/root/bin/:/usr/local/bin/"
Variable ${tNewLine}... (3 Replies)
Discussion started by: inspire87
3 Replies
7. Shell Programming and Scripting
I have some troubles with variables and quotes...
I want:
if $URL is empty (no user input) go to http://www.localhost/index.php/ else add this string (search) "?s=+$URL"
EXAMPLE:
No user input
string= http://www.localhost/index.php/
User input = "unix"
string=... (3 Replies)
Discussion started by: aspire
3 Replies
8. Shell Programming and Scripting
Is there any way to do variable nesting using sh?
For example:
example_1="a test string"
example_2="another test"
example_3="etc..."
i=2
echo ${example_$i}
The shell reports:
sh: ${example_$i}: bad substitution
If not, maybe someone could suggest another method. Thanks in... (3 Replies)
Discussion started by: kevinl33
3 Replies
9. Shell Programming and Scripting
Hi all-
I've been fooling with this for a few days, but I'm rather new at this...
I have a bash variable containing a long string of various characters, for instance:
JUNK=this that the other xyz 1234 56 789
I don't know what "xyz" actually is, but I know that:
START=he other
and ... (2 Replies)
Discussion started by: rev66
2 Replies
10. Shell Programming and Scripting
Hey, I'm writing this bash script that will test print me many copies of the same program but with different combos of 4 variables being between 1 and 100. Here's the code:
#! /bin/bash
x=0
for ((a=1; a < 101; a++))
do
for ((b=1; b < 101; b++))
do
for ((c=1; c < 101; c++))
do
for... (4 Replies)
Discussion started by: Silverlining
4 Replies