« first day (1907 days earlier)      last day (1361 days later) » 

06:58
There is a "/bin/sh: 1: Syntax error: redirection unexpected". I also tried: $ awk -F "," 'NR>1{system("qrencode -o "$1" <<<"$0)}' < file.csv but this error keeps gettting out.
@Einnerlink : can you share the first few lines of yur csv and i'll try o get it working
07:16
Name,ID,Phone,Cellphone,Email,Program
maybe system does not like the here string ... well in fact that way it would no longer be a here string and would need to be quoted
but it would b handy if you give me a few lines of your CSV ... even with fake data if privacy is an issue
Name,ID,Phone,Cellphone,Email,Program
me,1,+393481234567,[email protected],git

would be a valid example
Carlos Miguel Ruiz Ortega, 12345, 333-333-3333, 222-222-2222, [email protected], programing
ok I skipped the one of the phones
and as qr output filename it would be ok to use the id ?
id is unique ?
ok let me see if I can get it to work
07:20
Thank dude! I apreciate it!
I think it mostly works ... I don't have the qr genertor but this works for me:
bash-5.1$ cat my.csv
Name,ID,Phone,Cellphone,Email,Program
Carlos Miguel Ruiz Ortega, 12345, 333-333-3333, 222-222-2222, [email protected], programing
Juan Pablo Montoya,2,123-456-789,098-765-4321,[email protected],exfidriver
bash-5.1$ awk -F "," 'NR>1{system("echo -e "$2" <<<"$0)}' < my.csv
12345 Miguel Ruiz Ortega, 12345, 333-333-3333, 222-222-2222, [email protected], programing
2 Pablo Montoya,2,123-456-789,098-765-4321,[email protected],exfidriver
no let me try with a real redirection
I still got error: /bin/sh: 1: Syntax error: redirection unexpected
awk -F "," 'NR>1{system("tee -a "$2" <<< \""$0"\"")}' < my.csv
this worked right for me
bash-5.1$ cat my.csv
Name,ID,Phone,Cellphone,Email,Program
Carlos Miguel Ruiz Ortega, 12345, 333-333-3333, 222-222-2222, [email protected], programmer
Juan Pablo Montoya,2,123-456-789,098-765-4321,[email protected], driver
bash-5.1$ awk -F "," 'NR>1{system("tee -a "$2" <<< \""$0"\"")}' < my.csv
Carlos Miguel Ruiz Ortega, 12345, 333-333-3333, 222-222-2222, [email protected], programmer
Juan Pablo Montoya,2,123-456-789,098-765-4321,[email protected], driver
bash-5.1$ cat 2
Juan Pablo Montoya,2,123-456-789,098-765-4321,[email protected], driver
so try substituting
tee -a
with
qrencode -o
07:37
awk -F "," 'NR>1{system("qrencode -o "$2.png" <<< \""$0"\"")}' < file.csv
/bin/sh: 1: Syntax error: redirection unexpected
aha ... you are putting text after the id
you need to put that in the qutes
awk -F "," 'NR>1{system("tee -a "$2" <<< \""$0"\"")}' < Sheet1.csv
/bin/sh: 1: Syntax error: redirection unexpected
Well, qrencode saves the qrcode as png file
but do you get one for each line and is the qr content correct ?
awk -F "," 'NR>1{system("qrencode -o "$2".png <<< \""$0"\"")}' < file.csv
I suspect the qrencode is actually a bash script that dislikes the here string
Well I got this bash script I was trying and it works, but just to create one qrcode, that's why I decided to take a lookk at awk:
#! /bin /bash
echo "---------------------------------------"
echo " QR CONTACTOS"
echo "---------------------------------------"
echo
echo "Name: "
read name
echo "# ID: "
read id
echo "Program: "
read program
org="LAB ZONE"
echo "# mobile: "
read mobile
echo "Email: "
read email

echo "BEGIN:VCARD\nFN:$name\nTITLE:ID $id\nNOTE:$program\nORG:LAB ZONE\nCEL:$mobile\nEMAIL:$email\nURL:http://einnelrink.com/\nEND:VCARD" >qrcontact.txt

qrencode -s 6 -o "$id.png" < qrcontact.txt

#gwenview "$id.png"
08:35
non that
qrencode
itself
08:50
@Einnerlink : what does -s6 do ?
what do you get if you run
qrencode -s 6 -o 12345.png <<< "Carlos Miguel Ruiz Ortega, 12345, 333-333-3333, 222-222-2222, [email protected], programmer"
because that would be very similar to what awk would be calling with system
 
2 hours later…
10:26
google says it's the dot sze ...
I downloade qrencode and I tried it:
awk -F "," 'NR>1{system("qrencode -s 6 -o "$2".png <<< \""$0"\"")}' < my.csv
works fine for me
and the other one
bash-5.1$ cat my.csv
Name,ID,Phone,Cellphone,Email,Program
Carlos Miguel Ruiz Ortega, 12345, 333-333-3333, 222-222-2222, [email protected], programmer
Juan Pablo Montoya,2,123-456-789,098-765-4321,[email protected], driver
bash-5.1$
and the qr code reader in my phone can read them
not sure what's wrong on your system or if you did something wrong with the cutting and pasting
11:35
Mmm, right!!! qrencode -s 6 -o 12345.png <<< "Carlos Miguel Ruiz Ortega, 12345, 333-333-3333, 222-222-2222, [email protected], programmer" works. It create the QR code png file, and the info is there, but awk -F "," 'NR>1{system("qrencode -s 6 -o "$2".png <<< \""$0"\"")}' < my.csv doesn't
11:52
what system are you using ?
because for me that works ... what's in your my.csv file ?
Debian 10
even with the 2 line csv it will not work
or s it braking because of some wierd character inside the full csv ?
12:07
mybe your system is more pedantic about the field separator ....
there are sone spaces after the comas that might make a mess
@Einnerlink awk -F' *, *' 'NR>1{system("qrencode -s 6 -o "$2".png <<< \""$0"\"")}' < my.csv
Nothing yet: /bin/sh: 1: Syntax error: redirection unexpected
that will use as field separator the comas win arbitrary amount of space before or after the comas themselves
I'm tempted to try that on a debian box ... it's odd
what bash version do you have over there ?
bash-5.1$ bash --version
GNU bash, version 5.1.4(1)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
bash-5.1$
ash --version
GNU bash, versión 5.0.3(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
Licencia GPLv3+: GPL de GNU versión 3 o posterior <http://gnu.org/licenses/gpl.html>
12:24
Intresting ... I tried it on Raspbian 10 *much the same as debian 10
and I get your same error
dude use slackware :D
I will see if I can get it to work on buster (is that teh correct codename for debian 10 ?)
well it's a real ball buster for sure
Thanks again dude!
I suspect the awk over there will not take the here string inside system
let me see if I can rephrase it not to use it like that
ye confirmed ... yur awk does not like the here string usage ...
you will haveto echo " qrencode
awk -F' *, *' 'NR>1{system("echo \""$0"\" |qrencode -s 6 -o "$2".png ")}' < my.csv
something like this
let me test it over here ... I'm not loggen on the RPi to cut and paste it
should be ok
it s actually considered unnecessary to do echo "some string" | some_command
as you are unnecessarily forking a process
the here string usage is generally preferred as it is just using redirection
some_command <<< "some string"
@Einnerlink what do you expect from people that think that systemd is actually a good thing :D
@Queen : buzz off because your bee keeper aint here now :D
If you are a humorous bot you will laugh back at me :)
how can i find Dockers installation on OS X so i can add it to my path?
12:57
@Jarede ... sorry I've no experience with mac ... but maybe someone else can answer you
@louigi600 I'm not familiar with systemd issuue. I've read about it but I don't get it. I've always trust Debian & whatever they do I think it's gonna be useful.
but if you know the name of the executable you are looking for maybe you can use find
find / -type f -name "the name of yur executable" -print
i'm sure osx will have the find util
once you find where it is you can add it to your path
@Einnerlink ... you should try slackware ... you will probabbly hate it at the beginning because it requires you to know that you are doing
if you can live trough the hate period you might actually fall in love with it.
13:14
I'm downloading the slackware iso right now becasuse I need to save this task, maybe I'd love it, but I've also tried many, many distros but at the end I always go back to Debian.
I fixed your thing for debian ..
awk -F' *, *' 'NR>1{system("echo \""$0"\" |qrencode -s 6 -o "$2".png ")}' < my.csv
Whaaaaaa?
@Einnerlink ... let me bring to your attention that you should take more time to read the answers to your own help request :D
Oh man! That's awesome!!! If I could give you stars ranking I'd give you all!!!!
well you can voode one ov my answers on stack overflow ... it's the ame thng
https://stackoverflow.com/questions/45186643/auto-mount-usb-drive-from-udev-rules-and-shell-script/66527200#66527200
the last answer is a bit late and is there lonely with now attention ....
give it an up vote and it will be happy
13:30
@louigi600 Just one last thing. How about if I want each row data in a new line in the qrcode file? a "/n" because all the info is too tight, just separated by a comma.
you will haveto manuulare the string
awk has builtin string manupulaon with regex
put $0 in a variable
and then manupulate that
gensub might fit your case
relace the regex ' *, *' wit new line
all occourrences
13:46
I think I made a mess!
well I advised wrong ... gensub returnes the modified string
so no need to save $0 in a
here you go:
awk -F' *, *' 'NR>1{a=gensub(" *, *","\n","g",$0); system("echo -e \""a"\" |qrencode -s 6 -o "$2".png ")}' < my.csv
$ awk: line 2: function gensub never defined
ok try using gawk
maybe in debian awk in not the gnu awk
and that wuld explain also why the here strng created trouble
if you don't have gawk I thing it will be just a matter of
sudo apt-get install gawk
@Einnerlink will it work with gawk ?
or do we need to pipe a sed in the system ?
Yeah! That was easy!!! Just the first info in the QR code begins wuth "-e " + the name. The rest is fine.
14:01
ok remove the -e
i was for echo not to mess up the new lines
gawk -F' *, *' 'NR>1{a=gensub(" *, *","\n","g",$0); system("echo \""a"\" |qrencode -s 6 -o "$2".png ")}' < my.csv
@Einnerlink well is it ok now ?
Yeah! Definitely!!!
Thanks dude!!! I got just words just for thanking! And the star of course!!!
15:04
@Einnerlink ... I would appreciate if you click the up arrow on any of my answers on stackoverflow
for example the last answer over here:
https://stackoverflow.com/questions/45186643/auto-mount-usb-drive-from-udev-rules-and-shell-script/66527200#66527200
 
7 hours later…
21:41
Done!
22:25
thanks

« first day (1907 days earlier)      last day (1361 days later) »