#garfield Logs

Jan 22 2024

#garfield Calendar

11:41 AM polprog: afternoon
01:34 PM VanUnamed_ is now known as VanUnamed
06:35 PM rue_mohr: hi
06:37 PM Tom_L: so i upgraded the OS on the mill pc
06:37 PM rue_mohr: ok
06:39 PM Tom_L: i was kinda worried i'd never be able to on that motherboard
06:39 PM Tom_L: Intel D525
06:39 PM Tom_L: https://www.youtube.com/watch?v=b0VQFL-C72k
06:39 PM Tom_L: seems to work ok so far
07:21 PM rue_mohr: :)
08:47 PM Tom_L: try making any springs yet?
09:45 PM Tom_L: rue_mohr,
09:51 PM Tom_L: in a script how can i test if a file is there?
09:52 PM Tom_L: i have that working if there is only one file but if there are more than one (using a wildcard) it says it's not there
10:06 PM rue_shop2: https://www.aliexpress.com/item/33028152679.html
10:06 PM rue_shop2: Tom_L, there is a flag
10:06 PM rue_shop2: -e? or soemthing?
10:08 PM Tom_L: it screws up if there is more than one file
10:08 PM Tom_L: with -e or with -f
10:08 PM rue_shop2: yea I think you can only test one at a time
10:08 PM Tom_L: i've tested quite a few things
10:09 PM Tom_dev: FILE=$"/home/tom/mesact_2*.deb"
10:09 PM Tom_dev: if [ -f $FILE ]; then
10:09 PM Tom_dev: echo "$FILE File exists."
10:09 PM Tom_dev: else
10:09 PM Tom_dev: echo "$FILE File does not exist."
10:09 PM Tom_dev: fi
10:10 PM Tom_L: but one directory will always have 2 and on another test that directory will have 1
10:10 PM rue_shop2: if you want to check for 2 files you need to do 2 tests...
10:10 PM Tom_L: but i don't know the exact filenames
10:11 PM Tom_L: the version changes
10:11 PM Tom_L: lemme try something
10:13 PM Tom_L: i can add arm64, armhf or amd64 after the * wildcard and that may work
10:13 PM Tom_L: can i do an 'or' in the if statement?
10:13 PM Tom_L: what's the syntax for that
10:13 PM Tom_L: then i'll test for file and file2
10:14 PM rue_shop2: oh you dont want to test for a file
10:14 PM rue_shop2: you want to count files?
10:14 PM Tom_L: no
10:14 PM Tom_L: i want to know if either one is there and if so delete them
10:14 PM rue_shop2: tell me what you want to do tho...
10:14 PM Tom_L: i have the delete working
10:14 PM Tom_L: one sec
10:15 PM rue_shop3: for loop and grep maybe??
10:15 PM rue_shop3: -MoonyMoon
10:15 PM Tom_dev: FILE1=$"/home/tom/mesact2/mesact_2*arm64.deb"
10:15 PM Tom_dev: FILE2=$"/home/tom/mesact2/mesact_2*armhf.deb"
10:15 PM Tom_dev: if [ -f $FILE ]; then
10:16 PM Tom_dev: i want and OR to test for both files
10:16 PM rue_shop3: golly
10:16 PM Tom_L: the [ -f $FILE ] should say [ -f $FILE1 ]
10:16 PM rue_shop2: so you only want it to execute if both files exists
10:17 PM rue_shop3: inclusive or FILE1 FILE2 right?
10:17 PM Tom_L: if either do
10:17 PM Tom_L: not both
10:17 PM rue_shop3: Ahhh
10:17 PM rue_shop3: Exclusive or
10:17 PM Tom_L: i'm satisfied with a plain old or
10:17 PM Tom_L: |
10:17 PM Tom_L: ok
10:17 PM rue_shop2: <Tom_L> not both
10:18 PM rue_shop2: or would be true if both exist
10:18 PM Tom_L: i think i have it
10:19 PM rue_shop3: ok cool, because I dont ;3
10:19 PM Tom_L: it works
10:19 PM rue_shop3: :D great
10:19 PM Tom_dev: FILE1=$"/home/tom/mesact2/mesact_2*arm64.deb"
10:19 PM Tom_dev: FILE2=$"/home/tom/mesact2/mesact_2*armhf.deb"
10:19 PM Tom_dev: if [ -f $FILE1 ] | [ -f $FILE2 ]; then
10:20 PM rue_shop3: bute
10:24 PM Tom_L: just trying to make my build script fancier :)
10:24 PM Tom_L: mostly to learn
10:25 PM rue_shop3:
10:27 PM Tom_L: and inside that if, i check for each file then remove it
10:45 PM Tom_dev: http://paste.debian.net/1304993/
10:45 PM Tom_L: final result
10:46 PM Tom_L: easier to check them one by one
11:44 PM rue_mohr: ok wild ride ths afternoon, gnight
11:45 PM rue_mohr: Tom_L,
11:46 PM rue_mohr: why dont you do /bin/rm $FILE1 $FILE2 $FILE > /dev/null 2>&1
11:47 PM rue_mohr: why dont you do rm $FILE1 $FILE2 $FILE > /dev/null 2>&1