Hi everyone , i am trying to do a shell script with dialog , but i have a problem capturing each input variable to then use "echo" to write those inputs on specific orders in a file .
If i use this code :
what will happen is that the values from each input will be written on test file each one on each line .
And i want to retrieve each input value to use with "echo"
like
Using "echo" i can write all variables in one single line and add extra data to the line if i want , like this next example :
Anyone have an idea how to push dialog variables ?
The script i have here is working like i want with "read" command , but i want to make it graphical with dialog but i have no clue how to get what i need .
Moderator's Comments:
Please use code tags, not quote tags around snippets of code and data
---------- Post updated at 03:03 PM ---------- Previous update was at 10:55 AM ----------
I was going around on the web looking for pieces of code , so , i got how this must be done properly , here it is the solution for this issue .
dialog must create a single temp file for each input , and then "cat" must be use to read each input in those files , create a variable for each one in memory and then you can use "echo" to write those variables in some unique file .
After cat reads each variable you must delete the temporary files used for the imputs .
The script is something like this :
Last Update : The previous code will put your variables on a single line , bu i wanted to add extra data to "echo" command and i had issues doing that on 1 line only .
So , i had to use a different approach on the subject , i had to create a single file for all outputs and then use "sed" to read each line 1 by 1 and declare that data on variables to be able to do what i needed .
Basically there are some changes on the code , and i also am posting it here for my future consult and for others with same issue :
If
input 1 = ab
input 2= cd
input 3=ef
input 4=gh
then the output of this code written on testfile will be :
ab,cd,ef,gh
Last edited by pedropt; 12-05-2016 at 09:29 AM..
Reason: quote tags -> code tags
Hi I am having a code as stated below
module abcd( a , b , c ,da , fa, na , ta , ma , ra ,
ta, la , pa );
input a , b, da ,fa , na , ta , ma;
output c , ra ,ta ,
la ,pa ;
wire a , b , da , fa ,na ,
ta , ma;
// MBIST Structures... (1 Reply)
I am not able to capture errors while I am using dialog. For example:
dialog --gauge "Verifying file..." 10 75 < <(
while read LINE
do
hash=$(echo $LINE | cut -f1 -d' ')
directory=$(echo $LINE | cut -c 34-)
PCT=$(( 100*(++i)/n ))
echo $PCT
md5deep -a $hash $directory >... (3 Replies)
Ques from newbie
I want to total column X from large number of files, and view totals for each file separately with the filename.
I have tried:
for i in `ls -1 *.pattern`; do cat "$i" | awk '{SUM += $4} END { printf("%8d\t%8d\n", $i,SUM) }'; done
does not work. appreciate your help (5 Replies)
Hi Guys,
I wonder how can I determine when a given number is a multiple of another one in java. Let's say if I have 27 how can I determine whether is multiple of 5 using java programming. Thanks. (1 Reply)
Hi
I have this string with 3 seds..
cat /tmp/roletmp|sed "s/$role2del//" | sed "s/,,/,/" |sed "s/^,//" |sed 's/,$//'
How can I join these 3 seds in one?
regards
Israel. (3 Replies)
Hi,
IS possible in ksh to make multiples menus?
For example:
My menu.
1)Option1
1.1)Option1.1
2.3)Option1.2
2)Option2
2.1)Option2.1
.
.
.
x)Exit
I've tried with case but no success.
Thanks in advance. (3 Replies)
1. Why are the pointers' addresses every 32 ?
2. Am I correct in stating that memset is writing to memory that is not allocated to any of the 3 pointers ? Is it writing to memory in between the pointers ?
3. Are the 3 pointers contiguous in memory ?
4. I only allocated 10 bytes for each pointer.... (5 Replies)
Hi all,
I've got this question about using cp for copying multiples files from the same source directory to another directory, considering that my working directory ain't the same of the source directory.
Let me give you a simple example what I'm talking about:
Suppose the following files... (2 Replies)
Hi,
example of Unix / Linux dialog utility is below.
I am going to use dialog as simple GUI for testing of a modem.
So I need to combine some dialog boxes into one.
I need to have input box, output box, info box, dialog box,
radiobox as in any standard program with graphical user... (2 Replies)