asterinas/regression/apps/scripts/shell_cmd.sh

40 lines
632 B
Bash
Raw Normal View History

2023-03-16 03:00:09 +00:00
#!/bin/sh
2024-01-03 03:22:36 +00:00
# SPDX-License-Identifier: MPL-2.0
2023-03-16 03:00:09 +00:00
set -e
set -x
2023-07-05 06:08:58 +00:00
SCRIPT_DIR=/regression
2023-03-22 03:52:24 +00:00
cd ${SCRIPT_DIR}
2023-03-16 03:00:09 +00:00
touch hello.txt
mv hello.txt hello_world.txt
rm hello_world.txt
2023-11-02 09:37:21 +00:00
awk '{print $2}' shell_cmd.sh
cp shell_cmd.sh shell_cmd_backup.sh
cat shell_cmd_backup.sh
rm shell_cmd_backup.sh
2023-03-16 03:00:09 +00:00
2023-11-02 09:37:21 +00:00
ln -s shell_cmd.sh tesk_cmd_soft_link
2023-03-16 03:00:09 +00:00
readlink -f tesk_cmd_soft_link
tail -n 1 tesk_cmd_soft_link
rm tesk_cmd_soft_link
2023-11-02 09:37:21 +00:00
ln shell_cmd.sh tesk_cmd_hard_link
2023-03-16 03:00:09 +00:00
tail -n 1 tesk_cmd_hard_link
unlink tesk_cmd_hard_link
2023-11-02 09:37:21 +00:00
sed 3q shell_cmd.sh
2023-03-16 03:00:09 +00:00
2023-11-02 09:37:21 +00:00
find . -name "*shell_cmd*"
2023-03-16 03:00:09 +00:00
mkdir foo
rmdir foo
echo "Hello world from asterinas" > hello.txt
2023-03-16 03:00:09 +00:00
rm hello.txt
cd ..