Unix/Linux Go Back    

Showing results 1 to 25 of 500
Search took 0.14 seconds.
Search: Posts Made By: Don Cragun
Forum: Shell Programming and Scripting Linux 7 Hours Ago
Replies: 2
Views: 104
Posted By Don Cragun
You have already shown us that you know how to...

You have already shown us that you know how to get what you want:
text="iv-hhz-sac/hpac/hhz.d/iv.hpac..hhz.d.2016.250.070018.sac"
result=${text%.*}
result=${result##*/}
printf '%s\n' "$result"...
Forum: Shell Programming and Scripting Linux 7 Hours Ago
Replies: 3
Views: 179
Posted By Don Cragun
You can combine the two working printf statements...

You can combine the two working printf statements that are working into a single printf statement. The way you tried to do it didn't work because:

changing %% to %10s in the format statement...
Forum: Shell Programming and Scripting Linux 17 Hours Ago
Replies: 3
Views: 179
Posted By Don Cragun
The current execution time could be formatted in...

The current execution time could be formatted in grossly different ways that would require different format specifiers in a printf format string.

What is the format of the contents of the variable...
Forum: Shell Programming and Scripting Linux 22 Hours Ago
Replies: 6
Views: 255
Posted By Don Cragun
There are lots of scripts involved here. All of...

There are lots of scripts involved here. All of them include set -x to enable tracing, but you haven't shown us any of the results of those traces.

You say it doesn't work, but you don't explain...
Forum: Shell Programming and Scripting Linux 1 Day Ago
Replies: 3
Views: 257
Posted By Don Cragun
Why do you think that is a funny thing??? By...

Why do you think that is a funny thing??? By definition, a continuation backslash is a <backslash> character IMMEDIATELY followed by a <newline> character. If there is any character between a...
Forum: Shell Programming and Scripting Linux 1 Day Ago
Replies: 6
Views: 255
Posted By Don Cragun
Expanding a bit on what Jim has already said... ...

Expanding a bit on what Jim has already said...

Unless you redirected diagnostic output to /dev/null, one would assume that the code marked in red above would produce a message similar to:
-ksh:...
Forum: Shell Programming and Scripting Linux 1 Day Ago
Replies: 6
Views: 314
Posted By Don Cragun
That isn't an answer. You said the format of...

That isn't an answer. You said the format of your filenames is:
abcd_deft_2018-02-21_100012
abcd_mnpo_2018-02-21_100020
but your code looks for filenames ending with .txt. Which form is correct?...
Forum: Shell Programming and Scripting Linux 1 Day Ago
Replies: 6
Views: 224
Posted By Don Cragun
So, it sounds like you want something structured...

So, it sounds like you want something structured more like:
while read junk now junk
do
ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >>...
Forum: Shell Programming and Scripting Linux 1 Day Ago
Replies: 7
Views: 277
Posted By Don Cragun
As always, it helps if we know what operating...

As always, it helps if we know what operating system you're using and what you have tried to solve this problem on your own.

By listing bash along with awk, ruby, and perl are you saying that bash...
Forum: Shell Programming and Scripting Linux 2 Days Ago
Replies: 6
Views: 314
Posted By Don Cragun
To match filenames that end with "10" followed by...

To match filenames that end with "10" followed by four other characters, you can use the filename matching pattern:
*10????
If there might be other files that match that pattern and you only want...
Forum: UNIX for Beginners Questions & Answers Linux 2 Days Ago
Replies: 1
Views: 217
Posted By Don Cragun
Are you looking for a sort in increasing order or...

Are you looking for a sort in increasing order or decreasing order.

What is the format of your filenames?

If the files are created in the same order as the filenames imply, does the command:...
Forum: Shell Programming and Scripting Linux 2 Days Ago
Replies: 9
Views: 330
Posted By Don Cragun
I didn't look closely enough at the code that...

I didn't look closely enough at the code that vgersh99 suggested in post #5. The command substitutions are inside single quotes inside double quotes. Inside double quotes, the single quotes are...
Forum: Shell Programming and Scripting Linux 2 Days Ago
Replies: 9
Views: 381
Posted By Don Cragun
RudiC, jim mcnamara, and I all made made several...

RudiC, jim mcnamara, and I all made made several comments that should have helped you. It looks like you used one of my suggested and ignored everything else.

If you aren't interested in reading...
Forum: Shell Programming and Scripting Linux 3 Days Ago
Replies: 2
Views: 293
Posted By Don Cragun
I don't have ffmpeg installed on my system. What...

I don't have ffmpeg installed on my system. What does the final hyphen in the command:
ffmpeg -i "${FILE_NAME1}.aac" -f caf -
tell ffmpeg to do? With many utilities, that would be a request to...
Forum: Shell Programming and Scripting Linux 3 Days Ago
Replies: 17
Views: 373
Posted By Don Cragun
Sometimes the easiest solution is to just include...

Sometimes the easiest solution is to just include literal <newline> characters in your assignments as below:
outline="$outline
$line"
This will work with any shell designed to accept Bourne shell...
Forum: Shell Programming and Scripting Linux 3 Days Ago
Replies: 4
Views: 274
Posted By Don Cragun
If you are unable to answer the questions that...

If you are unable to answer the questions that Robin asked in post #2 in this thread, there is little chance that you will get much help. We depend on the information you provide to get the...
Forum: Shell Programming and Scripting Linux 3 Days Ago
Replies: 9
Views: 330
Posted By Don Cragun
Hi vgersh99, Note that command substitution...

Hi vgersh99,
Note that command substitution (neither $(command) nor `command`) does not work inside single-quotes. And, you have an extraneous <backslash> character after ... concerned team.' .
...
Forum: Shell Programming and Scripting Linux 3 Days Ago
Replies: 9
Views: 330
Posted By Don Cragun
For a start, it might help if you had matched...

For a start, it might help if you had matched double-quotes on the line:
BODY="Dear Team,\n\nKindly find the below host and their port which are unable to connect.\n \n `cat...
Forum: Shell Programming and Scripting Linux 4 Days Ago
Replies: 9
Views: 348
Posted By Don Cragun
As with any thread posted in this forum, there is...

As with any thread posted in this forum, there is information that we need to be able to suggest how you might want to proceed:

What operating system are you using?
What shell are you using?
...
Forum: Shell Programming and Scripting Linux 5 Days Ago
Replies: 10
Views: 425
Posted By Don Cragun
Fine. Then try the code I suggested in post #4,...

Fine. Then try the code I suggested in post #4, or the following code which I hinted to in the postscript:
{ for day in {1..207} {282..356}
do
if (( day < 10 )); then
daytag="00$day" ...
Forum: Shell Programming and Scripting Linux 5 Days Ago
Replies: 10
Views: 425
Posted By Don Cragun
What are you trying to match with . in the basic...

What are you trying to match with . in the basic regular expressions you are creating to be used as addresses in sed? What characters does a <period> in a BRE match? Each of the following sed...
Forum: Shell Programming and Scripting Linux 5 Days Ago
Replies: 10
Views: 425
Posted By Don Cragun
You have started well over 300 threads in the...

You have started well over 300 threads in the last seven years. You know what is needed for us to be able to help you efficiently:

The operating system you're using (which you have not...
Forum: Shell Programming and Scripting Linux 5 Days Ago
Replies: 7
Views: 365
Posted By Don Cragun
Your sample data included in your echo statement...

Your sample data included in your echo statement is nothing at all like the data you are looking for in the output from wget.
Maybe the following would come closer to doing what you want with a...
Forum: Shell Programming and Scripting Linux 5 Days Ago
Replies: 9
Views: 287
Posted By Don Cragun
Show us the exact output my script did produce...

Show us the exact output my script did produce (in CODE tags).

I turned on tracing in that script so we can see what is going on.

If you're not willing to show us the output it produced, there...
Forum: Shell Programming and Scripting Linux 6 Days Ago
Replies: 11
Views: 415
Posted By Don Cragun
Your code uses command substitution (i.e.,...

Your code uses command substitution (i.e., $(command arguments)). That involves forking a shell, executing command, waiting for command to finish, reading the results from command, and assigning...
Showing results 1 to 25 of 500

 


All times are GMT -4. The time now is 11:21 PM.