No such file or directory but file png exists

I'm newbie of Ubuntu.
This command was used for the xcowsay config file, and when I used the source command, it was an error:
-bash: alt-image=/home/abc/Documents/b_st_159.png: No such file or directory,
Tested with this command alt-image=$HOME/Documents/b_st_159.png in terminal, the error was same, but the file was already exists at this directory: $HOME/Documents/b_st_159.png when checking by using ls -la ~/Documents, the file has shown as green line like this:
-rwxr-xr-x 1 abc abc 471304 May 15 22:48 b_st_159.png
I was also using file command and it results file exits as shown below:\

$ file b_st_159.png
b_st_159.png: PNG image data, 1386 x 640, 8-bit/color RGBA, non-interlaced

So how to fix this error? file exists image
as same as I run in terminal P/s: I was also find in google but result is for executable file.

3

2 Answers

There is no need to run the source command here

If you have the config file in the correct location, on execution of the xcowsay command it will read the config in
To find where the correct location for the xcowsay config file location is check here

xcowsay reads a configuration file on startup. The configuration file can be stored in the XDG compliant location $XDG_CONFIG_HOME/xcowsayrc (which will default to $HOME/.config/xcowsayrc) or in your home directory at $HOME/.xcowsayrc. If the --config=FILE command line option is passed FILE will be processed after your personal configuration file.

A note on what is happening here,
The source command executes command from a text file but there are not necessarily bash command
Running source bash.rc works because everything in this file can be executed in a bash terminal

2

The question is not clear. I suggest you

  1. Show the exact xcowsay command you used, if any.
  2. Show the exact source command you used.
  3. Show the complete contents of your xcowsay config file.

In the meantime, perhaps using alt_image instead of alt-image works:

--image=file Use a different image instead of the cow. The corresponding config file option is alt_image.

I tried it and it works.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like