LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-25-2023, 03:06 PM   #1
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Rep: Reputation: Disabled
Alternative Commands to Print a Forward Slash?


Due to a bug in the PinePhone/xfce, the following commands do not produce a forward slash. I’m wondering if a veteran here can offer an alternative to these failed summons:

Code:
xdotool type /
Code:
printf '\x2f'
Code:
echo '/'
Thank you for any suggestion.
 
Old 06-25-2023, 08:37 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,407
Blog Entries: 28

Rep: Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166
Try this:

Code:
$ echo "/"
/
It worked for me on XFCE
 
Old 06-25-2023, 09:11 PM   #3
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Original Poster
Rep: Reputation: Disabled
Many thanks for your post. That command does work when executed in terminal, but doesn't when called from a script, even if I put a second of sleep before it.

I cannot figure out why this is so problematic. All the other special characters running along the top keys can be successfully scripted, just not a forward slash (which is part of the kb's ?/ key).

Thanks again.
 
Old 06-25-2023, 09:32 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,407
Blog Entries: 28

Rep: Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166
Whoops. But thanks for the kind words.

I found a thread at Stack Overflow which might help.

Last edited by frankbell; 06-25-2023 at 09:34 PM.
 
Old 06-26-2023, 12:44 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,126

Rep: Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373
would be nice to see exactly what did you try (how does your script look like?). In general / is not a special char for shell(s), but it may have a special meaning sometimes (which obviously depends on the usage).
 
Old 06-26-2023, 02:23 AM   #6
lvm_
Senior Member
 
Registered: Jul 2020
Posts: 1,020

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
`cat file-with-a-slash`

Although if even xdotool fails, it is probably so deep that nothing will help.
 
Old 06-26-2023, 02:27 AM   #7
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,846

Rep: Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222Reputation: 1222
Try different \escape levels:
Code:
xdotool type '\/'
Code:
xdotool type '\\/'
Code:
xdotool type '\\\\/'
 
Old 06-26-2023, 08:48 AM   #8
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,161
Blog Entries: 6

Rep: Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836
Quote:
That command does work when executed in terminal, but doesn't when called from a script
Code:
#/usr/bin/bash

echo -e "/"
echo -e "/ and / and / and /"

printf '%s\n' /
 
Old 06-26-2023, 09:31 AM   #9
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Original Poster
Rep: Reputation: Disabled
Thank you, everybody, for weighing with ideas/suggestions. I've tried every one, including @teckk's, and while they work as a command in terminal, they can not be called in a script. The top row of special characters is notoriously difficult in the PinePhone keyboard. In Phosh, I was able to call them in an edited us keymap,; in xfce, I've had to script them eg:

Code:
#!/bin/sh
sleep .3
xdotool type \`
So that all works on the top row, but when scripting a key such /?, it fails (though I can use said script to produce any other character other than forward slash). When calling the forward slash script in terminal, I see the terminal cursor blink, then produce nothing.

I very much appreciate folks' help.
 
Old 06-26-2023, 10:11 AM   #10
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,648

Rep: Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564
Quote:
Originally Posted by jakfish View Post
Due to a bug in the PinePhone/xfce
Where has this bug been reported?

 
Old 06-26-2023, 10:33 AM   #11
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Original Poster
Rep: Reputation: Disabled
Probably nowhere, since there may be few other users--if at all--that have my exact setup. And the issue is so arcane.

It is interesting to note that my hacked us keymap from Phosh works in xfce (the xfce desktop is simply installed on top of Phosh) with regard to making the ? key work as a Right_Shift, but the third layer modifier of Win/AltG to make a forward slash (AltG + ?/ = forward slash) does not work in xfce, nor did my working modifiers on the top row (AltG + 9 = underscore). Hence, my scripting for the latter.
 
Old 06-26-2023, 11:13 AM   #12
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,648

Rep: Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564

So instead of talking to the developers who are best placed to identify and fix the problem, you've not even bothered to check whether anyone else has encountered the same issue, and prefer to guess at workarounds in a place where it's significantly less likely that people share your setup... :/

 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't mount slash dev slash sr0 to mnt helmet1980 Linux - Software 2 04-17-2016 10:32 AM
question mark and forward slash osc~ Slackware 2 08-16-2007 12:32 PM
Script to convert DOS backslash to UNIX forward slash pro_chandan Linux - Software 1 10-24-2006 10:09 AM
forward slash being treated as escape character in shell? debiant Linux - General 1 07-19-2006 04:57 PM
Basic difference between / (slash) and /root (slash root) ? tofee Linux - Newbie 2 03-24-2006 04:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration