Search Results

Search: Posts Made By: Dark2Bright
2,146
Posted By kshji
After if it's always command in shells: [, [[, ((...
After if it's always command in shells: [, [[, (( are only some commands.

if commandline
then # exit status 0
:
else # exit status != 0
:
fi

[ and test are same command, usually...
2,146
Posted By neutronscott
[ is a command, but in bash it's a shell builtin....
[ is a command, but in bash it's a shell builtin.


$ ls -l /usr/bin/[
-rwxr-xr-x 1 root root 28300 Apr 28 2010 /usr/bin/[




test $i greater than $j. So that exit is 0 (success) if $i >...
2,146
Posted By balajesuri
$? is the exit status of the last command...
$? is the exit status of the last command executed. Check the below post:
https://www.unix.com/unix-dummies-questions-answers/355-testing-exit-status.html

You may try something like this:#!...
2,146
Posted By kshji
Return is exit from function. Not for return...
Return is exit from function. Not for return values. Stdout is method to return values.
$? = last command exit status, 0=ok, <>0 not so ok.

pattern()
{
val1=$1
val2=$2
(( val1 == 100...
2,146
Posted By neutronscott
You're rather ambiguous about this verify()...
You're rather ambiguous about this verify() function. It takes an argument? I don't see where...

'if' takes a command as an argument, [ is a command, grep is also a command. A function by default...
15,531
Posted By Corona688
When in doubt, replace gnuplot with cat to make...
When in doubt, replace gnuplot with cat to make sure your plotting script is what you think it is.
15,531
Posted By annazpereira
If you are still stuck on this, you need to use...
If you are still stuck on this, you need to use the back slash. f(\$1):f(\$4)
15,258
Posted By BeefStu
#!/bin/ksh curdir=`pwd` n20=$curdir/n20 ...
#!/bin/ksh
curdir=`pwd`
n20=$curdir/n20
msat=$curdir/n20/msat
if [ ! -d "$n20" ]
then
mkdir "$n20"
fi
if [ ! -d $msat ]
then
mkdir $msat
if [ $? -ne -0 ]
then
echo...
1,129
Posted By jlliagre
try: while [ $count -lt 15 ]
try:
while [ $count -lt 15 ]
2,487
Posted By Scrutinizer
No not really. What could have happened is that...
No not really. What could have happened is that his input files simply did not have asterisks in them. It could also be that he set globbing to off (i.e. no asterisk expansion) in his shell (not very...
2,487
Posted By Scrutinizer
It is because the * gets interpreted and expanded...
It is because the * gets interpreted and expanded by the shell to the content of the current directory. Just go into a directory and issue:

var=*
echo $var
If you put quotes around $var, you...
2,487
Posted By Scrutinizer
echo "$line" the best way to make an exact...
echo "$line"

the best way to make an exact reproduction is like this:
while IFS= read -r line
do
printf "%s\n" "$line"
done < infile > out.txt
Showing results 1 to 12 of 12

 
All times are GMT -4. The time now is 05:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy