08-21-2018
I have been struggling with bash for less than a month now.
The idea was to use existing bash script and ADD some functionality to it.
When I do coding I like to keep my attempts in code so I do not repeat it.
So I am spoiled by C ability to comment out block of code and found that using "cut" can be used in bash. Unfortunately I have learn the "#" used at the bash scrip in this fashion #!... is really not "commented out line " - so this "problem using "cut" may be same issue.
BTW I did build a simple test function and using two "cut' in succession works just fine - that is not the issue.
I have been writing "code" for few years and firmly believe the "computer" will skip commented out code as instructed and it really does not bother me I my code contains code which is NOT executed one way or another.
Right now my code just "exit"s before getting to offending code.
I will try to analyze / delete the offending code to get rid of this error.
4 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
Could you put some light on this:
> echo "ref_categorie=test" | cut -c1-15-
test
> echo "ref_categorie=test" | cut -c1-14-
=test
echo "ref_categorie=test" | cut -c15-
test
echo "ref_categorie=test" | cut -c15
t
>
It's executed on AIX if that matters. The man page is not very... (2 Replies)
Discussion started by: tsurko
2 Replies
2. Shell Programming and Scripting
Hi all,
I'm trying to extract string from variable in BASH. That's probably trivial for grep but I couldn't figure it out.
I want to get name, there's sometimes digit after it, but it should be left out.
STRING=http://name5.domain.com:8000/file.dat
Could someone help me with that?
Any... (10 Replies)
Discussion started by: cootue
10 Replies
3. Shell Programming and Scripting
Hi
Can anyone what I am doing wrong while using cut command.
for f in *.log
do
logfilename=$f
Log "Log file Name: $logfilename"
logfile1=`basename $logfilename .log`
flength=${#logfile1}
Log "file length $flength"
from_length=$(($flength - 15))
Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies
4. UNIX for Beginners Questions & Answers
I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies