Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Every living thing wants to survive. -- Spock, "The Ultimate Computer", stardate 4731.3


devel / comp.unix.shell / Fix the error in some csh scripts.

SubjectAuthor
* Fix the error in some csh scripts.hongy...@gmail.com
`- Fix the error in some csh scripts.Janis Papanagnou

1
Fix the error in some csh scripts.

<18e82f83-6e30-4daa-9703-56a8df895a0cn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7216&group=comp.unix.shell#7216

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:ac8:54b:0:b0:3a9:7ff3:3239 with SMTP id c11-20020ac8054b000000b003a97ff33239mr1591916qth.351.1675061639029;
Sun, 29 Jan 2023 22:53:59 -0800 (PST)
X-Received: by 2002:a5b:587:0:b0:745:e85c:f1f6 with SMTP id
l7-20020a5b0587000000b00745e85cf1f6mr3769873ybp.48.1675061638611; Sun, 29 Jan
2023 22:53:58 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Sun, 29 Jan 2023 22:53:58 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=103.149.248.28; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 103.149.248.28
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <18e82f83-6e30-4daa-9703-56a8df895a0cn@googlegroups.com>
Subject: Fix the error in some csh scripts.
From: hongyi.zhao@gmail.com (hongy...@gmail.com)
Injection-Date: Mon, 30 Jan 2023 06:53:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5505
 by: hongy...@gmail.com - Mon, 30 Jan 2023 06:53 UTC

On Ubuntu 22.10, I noticed that some system shipped environments initialization scripts have syntax or logic errors as follows:

werner@X10DAi:~$ . /etc/profile.d/debuginfod.csh
bash: debuginfod.csh.save: line 17: syntax error: unexpected end of file
werner@X10DAi:~$ . /etc/profile.d/gawk.csh
bash: alias: gawkpath_default: not found
bash: alias: `unsetenv AWKPATH; setenv AWKPATH `gawk -v x': invalid alias name
bash: alias: gawkpath_prepend: not found
bash: alias: `if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH ': invalid alias name
bash: alias: gawkpath_append: not found
bash: alias: `if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH ': invalid alias name
bash: alias: gawklibpath_default: not found
bash: alias: `unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x': invalid alias name
bash: alias: gawklibpath_prepend: not found
bash: alias: `if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH ': invalid alias name
bash: alias: gawklibpath_append: not found
bash: alias: `if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH ': invalid alias name
werner@X10DAi:~$ . /etc/profile.d/vte.csh
bash: vte.csh.save: line 19: syntax error near unexpected token `!'
bash: vte.csh.save: line 19: `if ( ! $?prompt | ! $?tcsh | ! $?TERM | ! $?VTE_VERSION ) exit'

Below are the contents of the above scripts:

werner@X10DAi:~$ cat debuginfod.csh
# $HOME/.login* or similar files may first set $DEBUGINFOD_URLS.
# If $DEBUGINFOD_URLS is not set there, we set it from system *.url files.
# $HOME/.*rc or similar files may then amend $DEBUGINFOD_URLS.
# See also [man debuginfod-client-config] for other environment variables
# such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS.

if (! $?DEBUGINFOD_URLS) then
set prefix="/usr"
set DEBUGINFOD_URLS=`sh -c 'cat "$0"/*.urls; :' "/etc/debuginfod" 2>/dev/null | tr '\n' ' '`
if ( "$DEBUGINFOD_URLS" != "" ) then
setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS"
else
unset DEBUGINFOD_URLS
endif
unset prefix
endif

werner@X10DAi:~$ cat gawk.csh.save
alias gawkpath_default 'unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`'

alias gawkpath_prepend 'if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH == "") then; unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKPATH "\!*"":$AWKPATH"'

alias gawkpath_append 'if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH == "") then; unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKPATH "$AWKPATH"":\!*"'

alias gawklibpath_default 'unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`'

alias gawklibpath_prepend 'if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH == "") then; unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKLIBPATH "\!*"":$AWKLIBPATH"'

alias gawklibpath_append 'if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH == "") then; unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKLIBPATH "$AWKLIBPATH"":\!*"'

werner@X10DAi:~$ cat vte.csh.save
# Copyright © 2019 Red Hat, Inc.
# # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# # Red Hat Author(s): Carlos Santos

# exit if non-interactive, csh, no terminal or old VTE versions
if ( ! $?prompt | ! $?tcsh | ! $?TERM | ! $?VTE_VERSION ) exit

switch($TERM)
case xterm*:
alias precmd 'echo -n "\e]7;file://$HOST"; /usr/libexec/vte-urlencode-cwd; echo -n "\e\\"'
endsw

I'm not familiar with these csh syntax in them. Any tips to fix these problems?

Regards,
Zhao

Re: Fix the error in some csh scripts.

<tr7t0m$36ull$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7217&group=comp.unix.shell#7217

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: Fix the error in some csh scripts.
Date: Mon, 30 Jan 2023 08:52:54 +0100
Organization: A noiseless patient Spider
Lines: 111
Message-ID: <tr7t0m$36ull$1@dont-email.me>
References: <18e82f83-6e30-4daa-9703-56a8df895a0cn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 Jan 2023 07:52:54 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b0571fcf6fe2b7eb0ab844a3293d993b";
logging-data="3373749"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+l8murvP1Y+vmyqdw4O6/6"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:Egn+pkduwjMWxwFBUmY4lYvyN0s=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <18e82f83-6e30-4daa-9703-56a8df895a0cn@googlegroups.com>
 by: Janis Papanagnou - Mon, 30 Jan 2023 07:52 UTC

On 30.01.2023 07:53, hongy...@gmail.com wrote:
> werner@X10DAi:~$ . /etc/profile.d/debuginfod.csh
> bash: debuginfod.csh.save: line 17: syntax error: unexpected end of file

On 30.01.2023 07:53, hongy...@gmail.com wrote:
> werner@X10DAi:~$ cat vte.csh.save
> # Copyright © 2019 Red Hat, Inc.

On 30.01.2023 07:53, hongy...@gmail.com wrote:
> I'm not familiar with these csh syntax in them. Any tips to fix these
problems?

You are running 'csh' scripts (that stem from Redhat) with a 'bash'.
So depending on who activated/called these scripts my suggestions are
to use a csh interpreter (as opposed to a bash) to call the scripts,
or, contact Redhat support if their distribution is buggy (which I'd
consider unlikely, though).

Janis

On 30.01.2023 07:53, hongy...@gmail.com wrote:
> On Ubuntu 22.10, I noticed that some system shipped environments initialization scripts have syntax or logic errors as follows:
>
> werner@X10DAi:~$ . /etc/profile.d/debuginfod.csh
> bash: debuginfod.csh.save: line 17: syntax error: unexpected end of file
> werner@X10DAi:~$ . /etc/profile.d/gawk.csh
> bash: alias: gawkpath_default: not found
> bash: alias: `unsetenv AWKPATH; setenv AWKPATH `gawk -v x': invalid alias name
> bash: alias: gawkpath_prepend: not found
> bash: alias: `if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH ': invalid alias name
> bash: alias: gawkpath_append: not found
> bash: alias: `if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH ': invalid alias name
> bash: alias: gawklibpath_default: not found
> bash: alias: `unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x': invalid alias name
> bash: alias: gawklibpath_prepend: not found
> bash: alias: `if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH ': invalid alias name
> bash: alias: gawklibpath_append: not found
> bash: alias: `if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH ': invalid alias name
> werner@X10DAi:~$ . /etc/profile.d/vte.csh
> bash: vte.csh.save: line 19: syntax error near unexpected token `!'
> bash: vte.csh.save: line 19: `if ( ! $?prompt | ! $?tcsh | ! $?TERM | ! $?VTE_VERSION ) exit'
>
> Below are the contents of the above scripts:
>
> werner@X10DAi:~$ cat debuginfod.csh
> # $HOME/.login* or similar files may first set $DEBUGINFOD_URLS.
> # If $DEBUGINFOD_URLS is not set there, we set it from system *.url files.
> # $HOME/.*rc or similar files may then amend $DEBUGINFOD_URLS.
> # See also [man debuginfod-client-config] for other environment variables
> # such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS.
>
> if (! $?DEBUGINFOD_URLS) then
> set prefix="/usr"
> set DEBUGINFOD_URLS=`sh -c 'cat "$0"/*.urls; :' "/etc/debuginfod" 2>/dev/null | tr '\n' ' '`
> if ( "$DEBUGINFOD_URLS" != "" ) then
> setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS"
> else
> unset DEBUGINFOD_URLS
> endif
> unset prefix
> endif
>
> werner@X10DAi:~$ cat gawk.csh.save
> alias gawkpath_default 'unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`'
>
> alias gawkpath_prepend 'if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH == "") then; unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKPATH "\!*"":$AWKPATH"'
>
> alias gawkpath_append 'if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH == "") then; unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKPATH "$AWKPATH"":\!*"'
>
> alias gawklibpath_default 'unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`'
>
> alias gawklibpath_prepend 'if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH == "") then; unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKLIBPATH "\!*"":$AWKLIBPATH"'
>
> alias gawklibpath_append 'if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH == "") then; unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKLIBPATH "$AWKLIBPATH"":\!*"'
>
> werner@X10DAi:~$ cat vte.csh.save
> # Copyright © 2019 Red Hat, Inc.
> #
> # This program is free software: you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> # the Free Software Foundation, either version 3 of the License, or
> # (at your option) any later version.
> #
> # This program is distributed in the hope that it will be useful,
> # but WITHOUT ANY WARRANTY; without even the implied warranty of
> # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> # GNU General Public License for more details.
> #
> # You should have received a copy of the GNU General Public License
> # along with this program. If not, see <https://www.gnu.org/licenses/>.
> #
> # Red Hat Author(s): Carlos Santos
>
> # exit if non-interactive, csh, no terminal or old VTE versions
> if ( ! $?prompt | ! $?tcsh | ! $?TERM | ! $?VTE_VERSION ) exit
>
> switch($TERM)
> case xterm*:
> alias precmd 'echo -n "\e]7;file://$HOST"; /usr/libexec/vte-urlencode-cwd; echo -n "\e\\"'
> endsw
>
>
> I'm not familiar with these csh syntax in them. Any tips to fix these problems?
>
> Regards,
> Zhao
>
>
>

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor