Can anyone tell why?

|
Fibonakki 2022-08-11 23:19:40
This worked for me i think. Idk how. Ofc I’m cat ing a dockerfile. Cat your actual text file
Fibonakki 2022-08-11 23:20:15
This way there is error checking as well. But idk why with dash e it doesn’t work
Fibonakki 2022-08-11 23:26:18
Cat cron.txt | sudo crontab -u <userid>
Fibonakki 2022-08-11 23:26:37
This literally works @armanhrshaikh idk what else you want
marcotrosi 2022-08-11 23:26:53
if it works then it doesnt get easier than that
Fibonakki 2022-08-11 23:27:07
I tried it 100% works
Fibonakki 2022-08-11 23:27:31
Just weird that you need to become sudo to change your own crontab this way
Fibonakki 2022-08-11 23:48:32
armanhrshaikh 2022-08-11 23:15:37
https://github.com/armanhrshaikh/sms_automation.git

Btw i did check your repo. If you are doing automation use ansible. It’s easier and more intuitive for beginners. And i just checked, there is a built-in cron module

Fibonakki 2022-08-11 23:48:35
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/cron_module.html
moogiwaraa 2022-08-12 06:32:34
Hello I am trying to check if clipboard contains any image

imgMime=image/png
mimes=$(xclip -sel clipboard -t TARGETS -o)

for mime in $mimes
do
echo $mime
if [ “$mime” == “$img_mime” ]; then
echo “Image present”
break
fi
done

The if check always fails. But it passes if image mime is hard coded, i.e., $mime == image/png.

Can anyone tell why?

armanhrshaikh 2022-08-12 06:47:11
Fibonakki 2022-08-11 23:27:31
Just weird that you need to become sudo to change your own crontab this way

No sudo permission here

Fibonakki 2022-08-12 07:26:56
armanhrshaikh 2022-08-12 06:47:11
No sudo permission here

Wdym?

Fibonakki 2022-08-12 07:27:07
You didn’t have to sudo? Did it work for you?
armanhrshaikh 2022-08-12 07:29:54
Fibonakki 2022-08-11 23:26:18
Cat cron.txt | sudo crontab -u <userid>

Not working

armanhrshaikh 2022-08-12 07:30:50
Fibonakki 2022-08-11 23:19:40
This worked for me i think. Idk how. Ofc I’m cat ing a dockerfile. Cat your actual text file

Please sharing

armanhrshaikh 2022-08-12 07:31:14
Fibonakki 2022-08-11 23:26:37
This literally works @armanhrshaikh idk what else you want

Could you share

marcotrosi 2022-08-12 07:41:00
moogiwaraa 2022-08-12 06:32:34
Hello I am trying to check if clipboard contains any image

imgMime=image/png
mimes=$(xclip -sel clipboard -t TARGETS -o)

for mime in $mimes
do
echo $mime
if [ “$mime” == “$img_mime” ]; then
echo “Image present”
break
fi
done

The if check always fails. But it passes if image mime is hard coded, i.e., $mime == image/png.

Can anyone tell why?

the only thing I see is that you named the variables differently. imgMime and img_mime

marcotrosi 2022-08-12 07:41:38
which is why it works when you insert the string hardcoded
Henk Metselaar 2022-08-12 07:41:57
armanhrshaikh 2022-08-12 07:29:54
Not working

Can you elaborate on that? What error message do you get, contents of cron.txt, your user uid and the exact command you enter?

marcotrosi 2022-08-12 07:44:55
Henk Metselaar 2022-08-12 07:41:57
Can you elaborate on that? What error message do you get, contents of cron.txt, your user uid and the exact command you enter?

he always does this with us, and I’m thinking about ignoring him when he sends such messages

moogiwaraa 2022-08-12 07:48:29
marcotrosi 2022-08-12 07:41:00
the only thing I see is that you named the variables differently. imgMime and img_mime

Ah sorry 🙈

Fibonakki 2022-08-12 07:51:16
marcotrosi 2022-08-12 07:44:55
he always does this with us, and I’m thinking about ignoring him when he sends such messages

Literally this has been a back and forth where i probably spent more time on his project than him

Fibonakki 2022-08-12 07:51:34
armanhrshaikh 2022-08-12 06:47:11
No sudo permission here

You don’t have sudo? Then you can’t do it that way

armanhrshaikh 2022-08-12 10:19:41
👍I got my solution !
Henk Fibonakki @marcotrosi

Thanks

thecatvoid 2022-08-12 10:37:28
marcotrosi 2022-08-12 07:44:55
he always does this with us, and I’m thinking about ignoring him when he sends such messages

miscommunication or whatever

marcotrosi 2022-08-12 10:40:57
thecatvoid 2022-08-12 10:37:28
miscommunication or whatever

not sure if it can be called miscommunication if it happens every week

marcotrosi 2022-08-12 10:41:17
I would go more with ignorance
marcotrosi 2022-08-12 10:41:31
and still I’m here to help every time
marcotrosi 2022-08-12 10:41:34
props to me
Henk Metselaar 2022-08-12 10:44:20
@marcotrosi you’re a saint.
Ceda EI 2022-08-12 10:47:18
marcotrosi 2022-08-12 07:44:55
he always does this with us, and I’m thinking about ignoring him when he sends such messages

You have patience. I have already added him to my mental “just ignore no matter what” list

marcotrosi 2022-08-12 10:49:22
understandable and legit
moogiwaraa 2022-08-12 11:55:59
#Tip
If you don’t want a command to be in bash history, start with a space.
Ceda EI 2022-08-12 12:05:48
moogiwaraa 2022-08-12 11:55:59
#Tip
If you don’t want a command to be in bash history, start with a space.

Keep in mind that this behaviour is not standard and is instead configurable via HISTIGNORE. Ignoring commands starting with space is often done by the distro bash config setting it which may or may not be done by your distro of choice

moogiwaraa 2022-08-12 12:12:15
Ceda EI 2022-08-12 12:05:48
Keep in mind that this behaviour is not standard and is instead configurable via HISTIGNORE. Ignoring commands starting with space is often done by the distro bash config setting it which may or may not be done by your distro of choice

Wow there’s bunch of history related variables, HISTCONTROL, HISTIGNORE, etc. Thanks ✌️

|