Search Results

Search: Posts Made By: franzpizzo
9,693
Posted By franzpizzo
The redirect to the standard is echo "Error"...
The redirect to the standard is

echo "Error" 1>&2

so

#!/bin/bash
if [ $# -lt 1 ] ; then #Check there is enough command line parameters.
echo "Not enough command line parameters" 1>&2...
3,165
Posted By franzpizzo
It is not nice but it works printf...
It is not nice but it works


printf "mysample%d\n" $( ls -1 mysample*|sed 's/mysample//'| sort -n )
20,742
Posted By franzpizzo
Hi, execute this IFS=, echo "1,2 3,4 ...
Hi, execute this

IFS=,
echo "1,2
3,4
5,6
7,8" | while read x y
do
echo "x=$x"
echo "y=$y"
done
4,819
Posted By franzpizzo
Hi, I add a clarification: if you apply this...
Hi, I add a clarification: if you apply this solution to the error output of a script may be necessary to redirect execute a redirect

./script.sh 2>&1 | awk -F' |:' '{print $4}'
1,244
Posted By franzpizzo
Hi, the error is the nested loops: try this way ...
Hi, the error is the nested loops: try this way

END=4
for ((i=1;i<=END;i++))
do
N=`sed -n ${i}p variable.txt`
mv ${i}.txt ${N}.txt
done
32,953
Posted By franzpizzo
@RudiC Hi, queston is: the request is a...
@RudiC
Hi, queston is: the request is a validation check or only a check for the range?
This check have not sense for alphanumeric value of test variable.
Thanks
3,539
Posted By franzpizzo
Hi, don't use the ' (single quote) around EOFfor...
Hi, don't use the ' (single quote) around EOFfor translate the variable value:


cat <<EOF
#!/bin/bash
connect("Welcome to /tmp/os/$var")
etc...
EOF
15,948
Posted By franzpizzo
Hi, this is a way: ps -ef|awk '{printf...
Hi, this is a way:

ps -ef|awk '{printf "%s\n",$2;}'|grep -q -w $MYPID

then check the $? variable: if 0 the pid exists, else not exists.
2,785
Posted By franzpizzo
Hi, if in your system is installed the expect...
Hi, if in your system is installed the expect command (https://www.unix.com/man-page/all/1/expect/) you can interface it with the ssh.
1,643
Posted By franzpizzo
Hi some time ago I have bypassed a problem...
Hi
some time ago I have bypassed a problem using jsch.jar (http://www.jcraft.com/jsch/) in a Java procedure.
972
Posted By franzpizzo
Hi, the date command return a output like ...
Hi,
the date command return a output like
Thu Feb 21 18:44:53 WEST 2013
the simbol ">" redirect the output of the command date in ~/test/log/test_bat.log, if a file with the same name already...
1,634
Posted By franzpizzo
Hi try to enclose the variable with double...
Hi
try to enclose the variable with double quotes:

if [ -n "$output" ]
....:b:
Showing results 1 to 12 of 12

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