Hi RudiC,
You may indeed object. But, you need a very recent version of bash to get that shopt option. On the latest release of macOS, the bash installed is version 3.2.57 which produces the following when trying to set that option:
and a man bash | grep lastpipe produces no output.
This User Gave Thanks to Don Cragun For This Post:
Hello guys.
In my script, i have the following code:
echo "The tarfile contains these directorys"
tar -tf file.tar > tarlist.txt
cat tarlist | awk -F/ '{print $1 "/" $2}' | nl
echo "Enter path of the directory you want to extract or just press enter to extract everything: "
read path... (1 Reply)
HI ,
I have to check the values of variable is blank or not.
exm :
###test
test1
var=`cate filename | head -1 | cut -c1-3`
I need to check the first three character of 1st line . if it is blank .then exit or we need to process .
Thanks in advance . (2 Replies)
I am testing a ksh script for email.
In the subject/content of the mail there is some dynamic variables like date and charges.
However these variables occupied the entire line erase other in that particular line
For e.g. there is a mail message:
This mail is intent...
Your total... (2 Replies)
Hi,
I am trying to execute a bunch of piped command which are stored in a variable, but only one command executed at a time, and rest of the pipes, commands and their arguments are considered as argument to the very first command.
Can you please help me in this?
bash-2.05$ cat test.sh... (1 Reply)
Hello everyone!
I am having an issue with a script I am trying to create.
I have an input file (named sort_$1.txt) like:
aaaa
bbbb
cccc
dddd
eeee
and I process it with the following code:
while read -r EachLine2
do (11 Replies)
Hi,
i am having one text file it contains some blank lines and i want to ignore that blank lines .
#! /bin/bash
clear
rdCount=0;
while read myline
do
echo $myline
let rdCount=$rdCount+1
done < ps.txt
echo "Total line=$rdCount"
and ps .txt contains the data- (17 Replies)
Hello, could you please help with this one. I have an input file like this:
123,4567,89000
123456789,9876543,12
and for the output I need strings to be with the fixed length, let's say 15, and if the string is -lt 15 to be populated with blanks at the end until it reach 15, like this:
123 ,4567... (1 Reply)
Hello All,
Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....?
I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping
through a string containing some of these "Illegal Characters". Now... (5 Replies)
Hi All,
I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Hi,
I would like use the output of my cut command as a variable in my following awk command. Here's what I've written.
cut -f1 info.txt | awk -v i=xargs -F'' '{if($6 == $i) print $20}' summary.txt
Where obviously the 'xargs' doesn't do what I want. How can I pass my cut result to my awk... (3 Replies)
Discussion started by: heyooo
3 Replies
LEARN ABOUT HPUX
break
break(1) User Commands break(1)NAME
break, continue - shell built-in functions to escape from or advance within a controlling while, for, foreach, or until loop
SYNOPSIS
sh
break [n]
continue [n]
csh
break
continue
ksh
*break [n]
*continue [n]
DESCRIPTION
sh
The break utility exits from the enclosing for or while loop, if any. If n is specified, break n levels.
The continue utility resumes the next iteration of the enclosing for or while loop. If n is specified, resume at the n-th enclosing loop.
csh
The break utility resumes execution after the end of the nearest enclosing foreach or while loop. The remaining commands on the current
line are executed. This allows multilevel breaks to be written as a list of break commands, all on one line.
The continue utility continues execution of the next iteration of the nearest enclosing while or foreach loop.
ksh
The break utility exits from the enclosed for, while, until, or select loop, if any. If n is specified, then break n levels. If n is
greater than the number of enclosing loops, the outermost enclosing loop shall be exited.
The continue utility resumes the next iteration of the enclosed for, while, until, or select loop. If n is specified then resume at the n-
th enclosed loop. If n is greater than the number of enclosing loops, the outermost enclosing loop shall be used.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words that follow a command preceded by ** that are in the format of a variable assignment are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign, and also that word splitting and file name genera-
tion are not performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), exit(1), ksh(1), sh( 1), attributes(5)SunOS 5.10 17 Jul 2002 break(1)