10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have many folders under which there is always a file with the same name, which contains the data I need to process later. A perl oneliner was borrowed
perl -e 'print "gene_id\t", join("\t", map {/(.*)\//; $1} @ARGV),"\n";' *_test.trim/level.csvto make a header so that each column... (5 Replies)
Discussion started by: yifangt
5 Replies
2. Shell Programming and Scripting
I have this code
#!/bin/bash
LZ () {
RETVAL="\n$(date +%Y-%m-%d_%H-%M-%S) --- "
return RETVAL
}
echo -e $LZ"Test"
sleep 3
echo -e $LZ"Test"
which I want to use to make logentrys on my NAS. I expect of this code that there would be output like
2017-03-07_11-00-00 --- Test (4 Replies)
Discussion started by: matrois
4 Replies
3. Shell Programming and Scripting
Hello,
I recently started going in depth with the shell, so I started learning from Linux Shell Scripting CookBook, 2nd edition. I am at the first chapter atm, and the author tells to define a function in the ~/.bashrc.
The function is below.
prepend() { && eval $1=\"$2':'\$$1\" && export... (1 Reply)
Discussion started by: Vaseer
1 Replies
4. Shell Programming and Scripting
Hi All,
I search the forum for my query, Glad that got solution to it. But i really want to understand how does this command work.
sed -e ':a' -e 's/\("*\),\(*"\)/\1~\2/;ta'
Basically it is replacing all the comma(,) characters in between quotes with a tilde.
Specially what does ':a' ,... (2 Replies)
Discussion started by: DSDexter
2 Replies
5. Shell Programming and Scripting
Hi,
Iam in a need for a script/function in KSH where I want to read a text file (property file) in block by block. Here is the example:
Heading Name Descripton
Block Block1 Value1 Description
Property Name Value
Property Name Value
Property Name Value
Property Name Value
Property Name... (7 Replies)
Discussion started by: ysreenivas
7 Replies
6. Shell Programming and Scripting
Dear Experts,
Please find below the script in perl and can any body convert this script exactly in to oracle 9i fiunction which will return the required result same as perl.
#!/usr/bin/perl
$nof=@ARGV;
@var2 = ();
for($n=0; $n<$nof; $n++)
{
$filename = @ARGV;
open... (3 Replies)
Discussion started by: shary
3 Replies
7. Shell Programming and Scripting
hi,
I am new to scripting and need your help to debug .
Here is my goal, I need to collect text,validate it and say if there is any error .below is the code
validate_fn()
{
awk ' ....
END {
if(condition)
return 0
... (2 Replies)
Discussion started by: rider29
2 Replies
8. Shell Programming and Scripting
Hi all,
i needed some help in understanding a few procedures and how exactly is the sequence?
FINISHED="Done"
COLUMNS=$( stty -a | head -n 2 | cut -d " " -f2 |cut -d " " -f4 )
COLS=$((${COLUMNS} -${#FINISHED} - 5))
RET_ARR="\010"
KILLLINE=${RET_ARR}${RET_ARR}
for i in $(seq 1... (0 Replies)
Discussion started by: wrapster
0 Replies
9. Shell Programming and Scripting
Hey guys.!
Need some help.I want to write a script , which should be continuosly running and should keep calling a function after every say 5 or 10 seconds.
I am done with almost all part of it, but figuring out how to keep the script continuosly running and how to keep calling a function after... (11 Replies)
Discussion started by: nua7
11 Replies
10. Shell Programming and Scripting
:confused:Hi ,
I have a script as shown below:
rpttxt()
{
name="$*"
awk '/'"${name}"'/ {print $2 $3"=" $4}' file.txt
}
xx = rpttxt "COL_HEAD_1"
awk 'BEGIN {printf("%36s \n ","'"$xx"'")}'
rpttxt() is a function..I want to store the final result of this function in... (3 Replies)
Discussion started by: jisha
3 Replies